Germany in that case will then briefly technically have nukes, but no ability to knowledge of how to launch or control them. Had Ukraine tried to hold onto those nukes and/or figure out how to launch them they would likely have been invaded by just about every country in the world, including the US, so they gave them up for a few bucks and some kind words.
And I strongly disagree about Iran. Pakistan is also an Islamic country (with its proper name being the Islamic Republic of Pakistan) and a nuclear power, and they haven't just decided to go nuke India who they have abysmal relations with. Religion does provide a different level of comfort with death (and Iran has a longgggggg history of enduring pain to expel invaders on top), but it does not just turn people into death cult members.
There's some irony in that if Iran had nuclear weapons their relations with Israel would likely have been much better. Because Israel wouldn't have been constantly attacking, assassinating, and otherwise doing everything they could to undermine the country. It's similar to how if North Korea didn't have nukes then South Korea, largely as a proxy of the US, would likely have been actively attacking them.