The world has shown that the only way for a country to have sovereignty is by having nukes - see what happened when Libya or Ukraine gave them up. Having just been attacked by US/Israel and talks from them of fomenting regime change, it is obviously in Iran's self-preservation to pursue nukes.
There was a deal in place to prevent this, and the US broke it.