Iran is a large and regionally-powerful country, with a history of being a very major player stretching back over 2000 years. It wants nukes I would suggest for two reasons: because Iran feels unusually threatened, not just by the West but also Sunni Muslim states, and secondly for status and to reflect that sense of importance.
Arguably, rather than develop nukes, Iran would do a lot better simply by "playing ball", facilitating trade and greater co-operation with the international community, as it could undergo a massive, China-like economic modernisation and industrialisation. On the other hand, it's not as if its intensely conservative, theocratic leadership, geopolitical situation and last century of history predispose it to that sort of outlook. Nevertheless, I would suggest that forms of security guarantees, economic and diplomatic progress would indeed make Iran less interested in developing nukes. And then there's also even less chance for war.