Answering from memory ... I'll have to check the details later.
Saruman's principle goal at this point was to destroy the Rohirrim as a fighting force. There was nothing to be gained by seizing Edoras, since TheodenThéoden had already evacuated it, and even if orcs could be persuaded to live there (they usually prefer caves), the new settlement would not produce soldiers in time for a war that had already started.
As for marching past Helm's Deep, in the book this would have been suicide. Helm's deepDeep had its own garrison, plus a strong force brought there by TheodenThéoden and EomerÉomer. In addition, the forces of the Westfold had been scattered, but not destroyed, at the Battles of the Fords of Isen. They could be regrouped in a few days. Now look at the map.
If Saruman's forces marched east, they would be in hostile territory, cut off from Isengard by a large force of the world's best cavalry. I may not be a wannabe Dark Lord, but this doesn't sound like good strategy to me.
Saruman's actual plan, besieging the main force of the Rohirrim in Helm's deepDeep (avoiding facing their cavalry in the open) was much better. Even with the relief troops brought by Gandalf and Erkenbrand (the scattered forces from Westfold) Saruman might still have won, if his army could regroup. He probably didn't expect to find a forest of huorns blocking their retreat.
It's harder to explain Saruman's actions in the film. He could have ignored Helm's deepDeep, given the weakness of the forces there; trying to trap EomerÉomer and overwhelm his riders with superior numbers might have been a better plan. One possibility is that he was determined to kill TheodenThéoden, knowing that the king could potentially inspire his people and gather a large army (which he does in The Return of the KingThe Return of the King). Otherwise, it's just the standard reason: because Peter Jackson.