What really bothers me about "solve the problems on Earth first" logic is that if we do that we're never leaving this rock.
21 TRILLION dollars has been spent to eradicate poverty. Over 40 years on there's been very little impact of the Great Society program to actually eliminate poverty.
Imagine, just imagine what 21 TRILLION could have done if spent on space exploration. We'd likely have moonbases, footprints on Mars, asteroid bases, much quicker international travel, large space stations. 21 Trillion is a lot of fucking money. We basically wasted it trying to solve poverty with handouts. I know that sounds harsh, but the numbers don't lie. We didn't fix poverty, I believe there is no way in hell that spending that money on space exploration wouldn't have had a much much greater impact on society.
Another comment mentioned the National and World pride derived from accomplishing very difficult feats like landing on the moon. That value, while not being economically measurable is something that truly does move humanity along and make people understand that for some things, we're all in this together. And I really think that is likely a more valuable outcome that the direct spending of money on poverty.