This has its roots in the cold war. When Indian PM Nehru decided he wished to forge a third, non-aligned path for his and other countries, independent of both the US led block and the Russian led block, we were not happy.
We put a lot of pressure on India. To escape that leverage, he turned to the Russians for some counter-balance, and started buying his arms from them.
Furthermore, he continued the small scale and "home-grown industries" policies pioneered by Gandhi. These protectionist policies protected small local industries from competition from outside global firms, principally Western, American ones. This was not kindly received by American commercial interests.
Pakistan, whose main perceived enemy is and always has been India, gleefully stepped into the breach, proclaiming themselves to us as our stalwart "anti-Communist" ally in the region, from the '50's on.
So, we began to give Pakistan enormous amounts of mostly military aid, which we thought was for anti-communist purposes but which Pakistan ever and always wanted to use to counteract the Indian military.
Now, hopefully, our 50's and 60's and 70's era diplomats weren't quite that naive, but we did plow all this money into Pakistan to pressure and punish India for daring to wish to be independent of our political sphere, and to hopefully insure, no matter how cynically, an ally in Pakistan who would do our bidding in the region.
But you can't buy love or loyalty. Not really.
An informative post to those who are usually clueless about the relationship, or rather, relationSHIT, between the US and India until very recently.
It should also be noted that along with Nehru's affinity towards the Soviets after America overtly supported Pakistan, his background and education must be accounted for as well. What I mean is that he went to school in England and then continued on to Trinity College in Cambridge. There, he was enraptured with Communism and Socialism as profound philosophies that would be the panacea to the common people. He always fancied himself a leader and with his brilliant oratory and supreme intellect, he found himself rubbing shoulders with the upper echelon of India's freedom fighters and of course, the Mahatma (Gandhi) himself!
It should also be noted that Nehru was a self-avowed atheist and had an enormous disdain for traditional Indian customs; he fancied himself the "last white man to rule India" (publicly stated this to John Galbraith)! And thus, once in power, he wasted no time in steering India towards a precipitous path towards a socialist democracy; something that was completely antithetical to the Indian collective conscience. Instead of declaring India a Hindu nation for Hindus, by Hindus, and of Hindus, he, with the blessings of the Mahatma, declared India a "secular, socialist democratic republic", leaving 100s of millions of Hindus shell-shocked.
It was also Nehru who decided to stop Sardar Vallabhai Patel, the Iron Man of India, from completing the accession of Jammu & Kashmir into the Indian republic! India had 660 princely states (approximately) before independence and when the rat British were kicked out, they had the temerity to tell all of the Maharajas (kings) that they could either join India OR Pakistan (India for Hindus, Pakistan for Muslims). They knew this would create turmoil and instability and thus the Partition of India was the final blow the British scum left India with. Of the ~ 660 kingdoms, more than 500 of them acceded to India; meaning, their rulers signed the Rule of Accession after being convinced

D) by Sardar Patel and VP Menon to join India. The idea was that Hindu majority areas would join India while Muslim majority areas would join Pakistan. However, there were several princely states, or kingdoms, that had either Hindu majority but Muslim ruler or Muslim majority but Hindu ruler and thus created a conundrum. Some examples of these kingdoms were Hyderabad, ruled by the Nizam of Hyderabad (one of the richest men in all of the world in all history) who was Muslim but his subjects were mostly Hindu as well as Junagadh. On the other side, the kingdom of Kashmir was majority Muslim but ruled by a Hindu king. The king of Junagadh, the wuss that he was, ran off to Pakistan abandoning his subjects; so the accession into India was quite easy. Hyderabad threatened to join Pakistan and since this kingdom was located in the south of India, far removed from the north-western and north-eastern regions of what would become Pakistan, Sardar Patel and VP Menon saw the debacle that would create down the road. They sent the Indian Army to the outskirts of the Nizam's kingdom and he signed the Rule of Accession immediately! The last kingdom to accede to India that remained "undecided" was Kashmir. When Sardar Patel convinced the king to join India, he signed the document and Kashmir officially became part of the Republic of India. While this was happening, riots broke out in Kashmir and the king began to equivocate his position. This led Sardar Patel to send the Army to the border of Kashmir when Nehru stopped him and told him, "We can solve this problem "peacefully through dialogue" and through the United Nations! And, 64 years after independence, Kashmir is still considered a "disputed" region by anti-Indian foreigners and the Muslim coup of 1989 forced the already small minority of Kashmiri Pandits (Hindus) to either flee or be killed. The real travesty of this whole shebang was that Nehru himself was a Kashmiri Pandit! Sardar Patel and VP Menon united most of the disparate kingdoms of Bharat into one republic. Nehru attempted to unite one and was not able to do it! Such is delusion of liberal Marxists who think EVERYTHING can be solved through dialogue and "talks".
On the notion of America's relationship with India since independence (India's), it is interesting to know that Dwight Eisenhower offered to arm and train the ENTIRE Indian army completely FREE of cost in exchange for America building a base on Indian soil. Nehru flatly rejected the offer and this, in addition to the non-aligned stand that India adopted, infuriated the American establishment. This further enabled the US to mollycoddle the Pakistanis of whom they had no idea about; their history, culture, or even reason for the country's existence. And so, America is only now, after six miserable decades, is starting to see the duplicitous nature of Pakistan.
India, in its hoary history, has never invaded anyone or destroyed any civilization. India has been forced with defending herself from barbarians since the time of Alexander the Not-So-Great. It should be of no surprise to those who are unaware of the machinations of the complex geo-political nature of the Indian sub-continent that Pakistan finds a natural ally in China and both countries see India as an "expansionist and aggressive" nation trying to grab the land of others! Such hypocrisy should make one physically sick! It should also be noted that China gave Pakistan nukes and consequently endangered the entire world. If Pakistan were to use its nukes, even one, it would set off WWIII and humanity back several decades if not worse.