With such a globalized world, that would never happen today. What caused it to happen in the first place?
There are many reasons that countries have pursued nuclear weapons. The most obvious is fear and lack of trust (the "security" reason). The USA pursued nuclear weapons because it feared Nazi Germany getting them, and it kept them because it feared the Soviet Union and Communism. The Soviet Union in turn pursued them because it feared the United States. China pursued them because the United States threatened them with "nuclear blackmail" in the 1950s and they recognized that they would be vulnerable if they did not have them. Israel's desire for nuclear weapons, as a small country that was repeatedly threatened by regional rivals, is similarly understandable. Just to list a few examples.
There are less obvious motivations as well. "Prestige" and "independence" are another pair. The United Kingdom decided to get its own independent nuclear arsenal after the USA stopped collaborating with them on nuclear issues in the 1940s, under the belief (which proved correct) that if the UK proved it had its own weapons the US would re-open collaboration again. The French developed nuclear weapons because they felt that no nation could be a "great power" in the 20th century without an independent nuclear arsenal, and that unless they had one, they would be forever dependent on the good graces of USA and NATO.
In the case of one country, South Africa, the motivation was very murky: an ill-defined sense of security and a tight connection between the military and mining industries that ended up, after decades, leading to a decision to develop a small, secret bomb program.
Anyway. There are many reasons to develop weapons. I don't know why you assume it would not happen today: the most recent addition to the "nuclear club" (North Korea) tested its first weapon only in 2006, and there is at least one state (Iran) that people do worry have nuclear ambitions (born out of the security motivation), and experts worry that in the next few decades we may see several new additions to the nuclear club beyond these. The idea that globalization ends the impulse seems entirely unwarranted to me.
A decent overview of the history of nuclear proliferation is Richelson's Spying on the Bomb. The literature on why states choose to "go nuclear" is rather large.