The logic here prior to the Emergence of a strong leader in Indira Ghandi -Jawarhal Nehru and his successive cronies were complete gimps and never had clues about foreign policies or strategic relationships are all about.
As our independence was obtained through Nonviolence, it was clear we are siding ourselves with the communists. But later we called a system called Mixed Economy, NAM and other juvenile antics that effectively isolated from US, UK and also kept us some distance from the Soviet Union.
An established and a World class dumbo in Nehru aligned with China through his stupid policy called Panchasheel and gave away our territory to them and even now when it comes to China we are afraid (or apprehensive) about taking a stance against them thanks to the stupidity of Nehru and the sound thrashing we got from them.