1) The government that signed the NPT on behalf of the people of Iran was not a democratically elected government. Therefore, their government's accession to the NPT regime cannot be considered to have been done with the free will of the people of Iran.
2) The reason why Iranians did not have a democratically elected government at the helm was because some countries(primarily Britain) overthrew a democratically elected government by engineering a coup and installed a dictator so that the dictator could allow them access to Iranian oil reserves thereby causing losses to the people of Iran.
The Iranians were made to sign the NPT by the use of unlawful interference in their internal affairs. In light of this, would it not be understandable if the Iranians refused to comply with the NPT?