Answer by Balaji Viswanathan:
A big factor is the Kissinger's diplomacy in the region that time. In their massive geopolitical game with USSR, US was blinded on its own key principles – killing democracy in Iran and Afghanistan, helping the French fight freedom fighters in Vietnam and helping Pakistan unleash a major genocide (). In the process of helping Pakistan during that genocide, Nixon made India very insecure, forcing it to go nuclear.
While India was always interested in going nuclear, the key event that tipped the balance was the 1971 Indo-Pakistan war. In that war, India was able to split Pakistan into two – create the new nation of Bangladesh. But, it was also a war that made India nervous because a number of big nations was on the side of Pakistan. US, UK, Saudi Arabia, Indonesia all threw their weight behind Pakistan. Sri Lanka provided logistical support and China helped slightly with weapons.
The US 7th fleet was closing in on Bay of Bengal [and the danger of US fighting India directly was only avoided by the massive presence of Russian ships blocking off that route – . China too luckily didn't bite Kissinger's tasty treat of attacking India on all 4 directions.
After the war was won, Indians never forgot how close they got to being surrounded by world's superpowers for the mere fault of trying to stop a major genocide in what is now Bangladesh. India understood the importance of nuclear deterrence and also the value of military power. Nine months after the war, Indian Prime Minister ordered the preparation for the test. Within the next 20 months, India tested its first bomb.
Indira Gandhi knew that the west would react harshly, but she had very little to lose. The west had already burnt its bridges in the 1971 episode and there was very little moral, economic, military or strategic argument that the west could make to stop India from going nuclear.
By going nuclear, India is actually able to help its poor. Wars affect poor disproportionately and through the power of nuclear weapons, India was able to stop fighting wars. No one dares bomb a country with nuclear arsenal. India's last full scale war was in 1971. By proving its worth, India got recognized by the western powers on a more equal footing and the resulting large trade since late 90s has helped chunk of poor grow to middle class.
The post-nuclear India is far better at protecting its people than the pre-nuclear India.