"What harm would it do to get out of the NPT, to reconsider it?" Ayat Allah Ahmad Janati told worshippers at Friday prayers at Tehran University.
"North Korea got out, many countries did not enter it, if we had not entered it would have been better, but we are free to reconsider, why shouldn't we reconsider?" Janati said in his sermon broadcast on state radio.
Iran, suspected by the United States of seeking to develop nuclear weapons, is under pressure to sign an additional protocol to the treaty allowing for snap inspections of suspect sites by international monitors.
"We should in no way accept the additional protocol which bears extra humiliation for us," added Janati, one of the most senior officials in the Islamic republic to suggest pulling out of the NPT altogether.
A week ago, the International Atomic Energy Agency (IAEA) gave Iran until 31 October to clear up suspicions it is using an atomic energy programme as a cover for nuclear weapons development.
The resolution demands Iran answer all the IAEA's questions regarding its enrichment activities, provide unrestricted access to UN inspectors and a detailed list of its nuclear-related imports.
Iran denies the charges against it and has angrily rejected the resolution, but the country remains divided on whether to continue cooperation with the nuclear watchdog.
"North Korea got out... if we had not entered it would have been better, but we are free to reconsider, why shouldn't we reconsider"
Ayat Allah Ahmad Janati
Janati said allowing tougher inspections was out of the question.
"If we sign the additional protocol, they can inspect anywhere they want. One day it could be the Majlis (parliament), and the next day the office of the supreme leader (Ayat Allah Ali Khamenei)," he said.
"Iranians will stand firm against the criminal and conspiring United States and will not accept this humiliation," he said, to the habitual chant of "Death to America, Death to Israel" from the crowd of worshippers.
Iran's government is currently discussing the terms of the additional protocol with the IAEA, saying it wants certain "ambiguities" in the text to be clarified before it can make a decision on whether to sign.