To attack Edoras would have been useless to Saruman. Theoden and his people had already abandoned the Golden Hall, and had retreated to Helm's Deep. In fact, Aragorn did partially answer this question in the movie.
"They do not come to destroy Rohan's crops or villages, they come to destroy it's people, down to the last child."
Aragorn said this to Theoden while they were inspecting the defenses at Helm's Deep. Saruman's main aim was to subdue the people of Rohan and, if possible, kill Theoden King. Remember, earlier in the series, he had already claimed lordship over Rohan, as mentioned Eomer son of Eomund in both the movie and the book. Saruman got Wormtongue to poison Theoden's mind, allowing his orcs and Uruk-hai to roam at will, killing the people of Rohan.
He did not really need to attack Edoras, as there wasn't anyone there. Thanks to his claimed lordship, he already owned the place in his mind. But he needed to wipe out the people of Rohan, which meant he had to go to Helm's Deep. This is also evidenced by the fact that he used the information Wormtongue gave him after fleeing Edoras to attack the Rohan caravan on the road to Helm's Deep. Given a choice, he would have waylaid Theoden and his people along the way to Helm's Deep with Wargs, and then fallen upon Helm's Deep with it's reduced garrison and wiped them out. But since the attack along the road to Helm's Deep failed, he had to challenge them all at the garrison itself.
This, of course, is following mainly movieverse. However, in the book itself, it is also mentioned that Edoras could have been attacked.
"Where is Eomer? Tell him there is no hope ahead. He should return to Edoras before the wolves of Isengard come there"
Theoden had sat silent, hidden from the man's sight behind his guards; now he urged his horse forward. "Come, stand before me, Ceorl!" he said. "I am here. The last host of the Eorlingas has ridden forth. It will not return without battle."
The man's face lightened with joy and wonder. He drew himself up. Then he knelt, offering his notched sword to the king. "Command me, lord!" he cried. "And pardon me! I thought-"
"You thought I remained in Meduseld bent like an old tree under winter snow. So it was when you rode to war. But a west wind has haken the boughs," said Theoden.
So we can see here that if Theoden had remained in Edoras, Saruman would probably have attacked it. However, since the king had ridden out to war, Saruman's main priority was turned away from Edoras to Helm's Deep.
Another reason, apart from just the fact that the king was in Helm's Deep in that time, could have been that Saruman wanted Helm's Deep for himself first. Edoras was on the plains in the middle of nowhere, so it could wait it's turn. Plus initially, Wormtongue was at Edoras, so the King was essentially his already. However, the garrison at Helm's Deep was strong, and it was almost right on his doorstep. To capture Helm's Deep with or without the King there would have been a massive asset for him.
Specially for that purpose, he created a device that could even bring down the Deeping Wall. It was probably something like gunpowder, but in those times, it couldn't have been easy for him to come up with it, and he must have planned the attack on Helm's Deep for a long time. Between Isengard and Helm's Deep, he could effectively block the Gap of Rohan completely off from anyone. Rohan and Gondor would have been cut off, and it would have been difficult for Rohan to come to Gondor's aid. That way, Saruman would have delt with Rohan, leaving Mordor free to deal with Gondor, starting with Minas Tirith.