India isn’t really an ally of the west.
For example, it was historically non-aligned but on friendly terms with the Soviet Union:
> In 1954, the United States made Pakistan a Central Treaty Organization (CENTO) ally. As a result, India cultivated strategic and military relations with the Soviet Union to counter Pakistan–United States relations.[2] In 1961, India became a founding member of the Non-Aligned Movement to abstain from aligning with either the US or the USSR in the Cold War.
https://en.m.wikipedia.org/wiki/India–United_States_relation...
Pakistan is/was a closer and more reliable ally for the United States.
For another example where India disregarded the interests of the west:
> In 1970, Indira Gandhi enacted legislation which barred medical products from being patented in the country.
https://en.m.wikipedia.org/wiki/Pharmaceutical_industry_in_I...
Of course, India would seem to be a natural ally given that both countries are committed democracies and there is massive immigration from India to the United States, but in practice the United States likes the reliability of less-democratic states and India likes to control its own affairs and is powerful enough to do so.
So it goes.