Again, Cold War strategic calculations drove US foreign policy toward Pakistan. Having Pakistan as an American ally was seen as essential to blocking Soviet and Chinese access to the Indian Ocean. India’s socialism was also at odds with US political and diplomatic concerns.
Pakistan was picked as an ally by US because of its geostrategic location and because it was then the largest Muslim country. US was then in alliance with Muslims (with Turkey, Pakistan and Saudi Arabia) being the most important bulwark against the Soviet Union. India was seen as a poor, third world country that wouldn't survive as a nation due to her extreme diversity and chaotic democracy. Successive US administration had absolute contempt in the manner in which they dealt with Indian leaders back then.
And American’s like you never fail to beat India with the “socialist” stick conveniently forgetting US actually befriended the world's largest communist country China.