The government apparently believes that money talks, and everything else walks. Europe has been told (officially) that Iran will continue its nuclear power program and (unofficially) its nuclear weapons program. The government is confident that its business partners, Russia and China, will use their UN vetoes to prevent any UN sanctions. The government apparently also believes that Europe will eventually do their usual compromise dance and restore full economic relations with Iran. The Europeans insist they won't fold, but history is against them. Iran needs free access to European manufacturers if they expect to rebuild their armed forces.
Meanwhile, the government deals with widespread internal dissent with a combination of armed force (especially against recent violence by Kurdish and Arab Iranians), economic growth and nationalistic slogans. With oil going for over $60 a barrel, there is more money to spread around. High unemployment makes this money a powerful weapon. Talking up the nuclear weapons program is very popular. Iranians see themselves as the traditional superpower of the region, and nuclear weapons will enable them to regain that status. That's because over two decades of sanctions has left the Iranian armed forces weak. Training and leadership has been crippled by the need for key military leaders to be politically reliable (that is, Islamic conservatives). The sanctions have prevented the military from maintaining weapons and equipment, or buying much new stuff. A growing domestic arms industry has provided supplies of the simpler weapons. But the Iranians are pretty weak when it comes to high tech weapons. Some nuclear weapons would change all of that.
The Islamic conservative minority (about a third of the population) that rules the country are mainly interested in holding on to their power. Makes sense. But that means everything else is secondary, including the Iranian economy, the welfare of the Iranian people and peace in the region.
The Islamic conservatives that rule the country openly preach the need to destroy the United States, support Islamic terrorism and establish a world wide Islamic republic. This differs from al Qaeda in that the Iranian fanatics want a Shia Moslem world government, while al Qaeda wants a Sunni Arab world government. Meanwhile, Iran's neighbors worry about Iran getting stronger militarily, and using that power to expand the size of Iran. That's what has happened so many times in the past.