Not sure about Mars specifically or for that matter how many have space programs:
European Space Agency - There are some pretty deprived parts of the EU (Berkshire for instance).
Russia - There are some pretty big issues there too
USA - Huge underclass, widespread poverty and illegal migrant worker issues
India - Millions in poverty.
North Korea - no issues there, seems pretty stable
And the point I would make is that humankind has the ability to send scientific missions to other planets in the solar system, and it sure as hell has the ability to organise its affairs so that no one has to live in poverty, That applies, as you say, to the USA and Europe just as much as it does to India and China, but if we're saying that societies should not try to progress in business, science or technology until every vestige of poverty has been eradicated then we'd still be riding around on horseback (except most of us, being peasants in a pre-industrial society, wouldn't be able to afford a horse).
The likes of India and China are now advanced scientific and technological societies. The fact that large parts of those societies don't benefit, and won't benefit for the foreseeable future, shouldn't exclude them from the space industry.