Iran is doing a similar kind of thing to the United States now. Their regime is unpopular with its citizens and is likely to suffer (if by comparison only) if right next door in Iraq, a secular democracy takes hold and begins to flourish. They therefore have been doing what they can to hinder our efforts there--supplying weapons, funding and training to insurgents operating in Iraq. If we directly attack Iran, their people are likely to "rally around the flag" and support the theocrats, which is bad for us and good for the Iranian regime. If we don't attack Iran, they have no reason to cease their mischief in Iraq.
Do I have any solution to this conundrum? No. But some ideas to mull-over...
How about a covert attack on their nuclear facilities at Natanz? There is a lot of risk, in that everyone will know we were behind it, but if we were careful there would be no proof. A second idea would be to create gasoline shortages in Iran. Iran is an exporter of oil, but imports gasoline. They sell gasoline at below market rates in Iran, so the stuff they purchase from abroad costs more to buy than they sell it for. If we were to sabotage their refineries, then it would cost their government to replace the gas from imports, or they could ration, or raise prices--whatever they do, we cause pain to the Iranian theocrats.
One way or the other we need to send a signal that there is a price to be paid for their mischief.