1) It distracts from their internal problems, and it unifies their population against an external enemy (America, Israel, the west, satan).
2) It makes them a major player on the world scene. Iran (like North Korea) craves legitimacy.
3) A destabilized ME would open the door to their expansion. Iraq is weak (or nonexistent), and Iran could easily waltz in unlike the 1980s. That would give them oil fields, and they'd be inching closer to Israel, Jordan, Kuwait, Oman, and Saudi Arabia.
4) I'm not sure it would come to a ground war, and I'm not sure they would lose it. First of all, who would the ground war be against? Saudi Arabia? That could go either way. Against the US? I don't see us putting boots on the ground in Iran.
5) Behind Iran is Russia. Russia would love to extend their influence or even direct control, south to the gulf and then west to the Mediterranean. The risk for Russia is that Iran is an unreliable partner, but they're willing to take that risk because Iran is not the US.
6) What do they have to lose by poking the bear? 7 cruise missiles did a lot of damage to the Saudi's capability, and sent oil prices sharply upwards. What can we do to Iran with the same cost-to-benefit ratio?
7) What's the worse case that can happen to Iran? The world will hate them more? They don't care. There will be more economic sanctions? The'll wait until the US elects another democrat for president to rescind the sanctions. They will lose a war and be a defeated nation? That won't happen. Really, their greatest risk in an internal revolution, but those haven't been going well for the west lately, and so far they have a pretty tight grip on their citizens.