Nuclear weapons are arguably necessary with a nuclear armed neighbor they've regularly been at war with, and the space missions have the potential to make profits for India.
The US funds space missions with folks dying for want of medical care, but people don't tend to complain about that.
I'm not sure funding their NHS is going to do all that much good when the drug costs multiple times the per-capita income of Indians.
This is misleading; if the gains you obtain by having a nuclear and space program in the long term are greater than not having them and investing somewhere else, then the rational choice is to have them even if you're poor.
India is a country that likes to play poor when there's some advantage to be had, but it's a facade.