Why did US allow India to develop nuclear weapon but doesn’t want other countries to do the same?

It’s not like the United States is ecstatic about the fact that India developed nuclear weapons. But the reality is that India never signed the Nuclear Non-Proliferation Treaty and so India had a legitimate argument for possessing nuclear weapons.[1]

On the other hand, nearly every other country in the world has signed the NPT and pledged to not develop nuclear weapons beyond the five countries that possessed nuclear weapons at the time, and so the United States (and, really, everyone else) is just trying to make sure that they go along with the rules that they agreed to.

[1] And it’s not like the U.S. did nothing, they did impose sanctions on them for a while, but they just never gained the traction needed to result in serious change.