It's the signals with the NK issue, in which nuclear proliferation will yield benefits in negotiations for denuclearization. More so, to be a regional power, securing the state is equally as important to Iran. That's why short-term it makes sense to at least on mostly large scale to accept the terms (meaning that they for most part are followed), but that's just a delay at best. To secure its position, Iran needs nuclear weapons as well, and it has in a bipolar systems options to use the struggle of power to secure support for it to accomplish so. The only hope was for trade and economic freedom to work its magic as a de-escalator. With how the US allies itself in the Middle East, it was pretty much doomed though.
The deal functioned mostly as a way to keep the nuclear proliferation in the Middle East at bay for a while. Realism is still a principle in international relations to be reckoned with and sanctions aren't something that'll just outright make it irrelevant to follow the principle of power.
We both largely agree that the current Iran nuclear deal is mostly for delaying and giving us a warning to their intentions. That is what it was always about. Delaying it via international agreements is better than just leaving the agreement, which will force Iran to keep striving for nuclear capabilities to protect itself from US.
I disagree with you on the need for nuclear weapons. Iran does not need nuclear weapons to become a serious regional power, because it already is one as the Gulf States are their competitors.