The reasoning goes much beyond that. Post Independence, before any other 'enemies' were created there was a fear that India would be subjected to colonisation/balkanisation by western powers. Being an extremely backward country, it was believed our conventional weaponry would not stand a chance against the western powers. This is Nehru's speech in 1946, pre-Independence :
"
As long as the world is constituted as it is, every country will have to devise and use the latest devices for its protection. I have no doubt India will develop her scientific researches and I hope Indian scientists will use the atomic force for constructive purposes. But if India is threatened, she will inevitably try to defend herself by all means at her disposal"
It was on the basis of this, that, Nehru and Bhabha, started off the 'peaceful' atomic program. To ensure security for a fledgling state from western powers. Pakistan had no equation to play in any of this, though you may want to blow your trumpet.
The genesis of the Indian nuclear bomb lies in the 40s, not later. Much before Pakistan or China were ever a threat.
@Joe Shearer feel free to correct me.