Walter Russell Mead offers a good explanation for why the Iranian theocratic system has lasted:
Iran’s revolutionary system has proven so durable (already lasting almost half as long as communism did in the Soviet Union) in part because its political system is intelligently designed. Elected politicians compete for office and take responsibility for a lot of what governments do: economic policy, schools, fixing potholes and so on. They also dispose of a lot of patronage and give a lot of government business to those they wish to reward. That makes Iranian politics more interesting to voters than the typical immobility of autocratic states. The Supreme Leader keeps ultimate power in his hands, but if the city government hasn’t fixed the road in front of your house, you don’t blame him.And since so many people are dependent on the state for patronage, it makes the job of reformers doubly difficult, because it makes so many people complicit in the happenings of the government. If you have your niche, no matter how meager, you'll fight like hell to keep it.
In other words, Iran has a ‘deep state’ where the real power lies and a ‘shallow state’ where politics happens. This is a form of government that has a long history in the region, and to some degree it is what we see today in countries like Jordan, Egypt and Pakistan. (Until recently we saw it in Turkey as well.) It offers a more flexible and perhaps more durable political system than a pure dictatorship, but at the cost of allowing more public input into relatively trivial issues it solidifies the hold of the real rulers on the issues that count.