says that Iran signed that agreement while Israel didn't.
What did Iran get out of that agreement?
To be brief: Iran gained her nuclear program through joining first the Atom For Peace program then the NPT.
Iran's nuclear program was launched during the shah's rule and was heavily supported by the US and later on also by France and West Germany.
They provided the knowledge, the access to the technology, the highly enriched uranium, they built the facilities.
For Iran to get these benefits she needed to make the commitments to not attempt to gain nuclear weapons.
The [Non-Proliferation Treaty] is often seen to be based on a central bargain: “the NPT non-nuclear-weapon states agree never to acquire nuclear weapons and the NPT nuclear-weapon states in exchange agree to share the benefits of peaceful nuclear technology and to pursue nuclear disarmament aimed at the ultimate elimination of their nuclear arsenals”.