1. Why not to build a nuclear bomb?
What threats? These are not threats. Only huff and puff. And we don't know whether Iran is in possession of nukes or not. In fact there are many reasons to believe that Iran is already in possession of nukes. But why Iran doesn't make a nuke now with its uranium? I can give you tens of reasons if you're interested to know.
2. Why not to show off their achievements?
Iran will be under heavier sanctions, it'll have worse international image, it'll get more isolated like North Korea, for what? Iran can never use its nukes against any other country, so why Iran needs to tell the world that I have nukes? What does Iran gain from that except being more isolated? Israel is in possession of nukes but never admits it. What Iran is doing now is some sort of what they call it 'tit for tat'.
Now the difference: all global powers, supported Israel in its war with Arabs but in the Iraq-Iran war, all global powers supported Iraq in its war with Iran. In fact Israel war wasn't a win for only Israel, because it had the support of global powers, while Iran's war can be seen as a defeat for the global powers because they failed to reach their goals against Iran.