"We should wait for all the problems on earth to be solved before going into space".
I've seen this sentiment multiple times, and I disagree vehemently.
1. There are other much more worthy targets of this kind of argument
Whenever a space mission has cost overruns in the billions, I convert the dollar amount into B-2 bomber equivalents. That is, 2 billion USD = 1 B-2 bomber (lifetime cost). Hubble Space telescope = 0.75 B-2 bombers. James Webb Space Telescope = 4.7 B-2 bombers (as of 2019). And let's not get drawn in to the wastefulness of the F-35 fighter cost overruns. As a fraction of the total spending of the US government, Space exploration is tiny.
2. We will never truly solve all problems on earth
At least, we will never solve all the perceived problems on earth. Remarkable changes have occurred over the last century, diseases that once ravaged entire populations are now functionally extinct, death by violence has been steadily going down, and ours is currently the most peaceful time in existence, contrary to what you might believe from watching the news (For more on this, check out Steven Pinker's The better angels of our nature), and finally, technology (and with it our ability to do things) is increasing at a rate unprecedented in history.
But all of these processes are slow, in comparison to the experiences of daily life. The gradual improvement of life is invisible when a gross injustice is inflicted upon you in the here and now. And due to the accessibility of worldwide news and the internet, reporting of gross injustices has never been more prevalent.
There will always be problems, both real and perceived, which is why waiting for them to be solved before embarking on space exploration would mean we never got to do space exploration.
3. Space exploration is the single best long-term thing we can do
This I think is the most important part. Earth's time as a habitable planet is (geologically speaking) nearly up. Due to the sun's increasing brightness, earth will be rendered uninhabitable somewhere between 100 million and 1 billion years in the future. And that's the optimistic scenario that ignores climate change or any other cataclysmic event.
Humanity can't survive on earth forever. We must become an interplanetary or interstellar species if we are to survive the death of our earth or sun.
There's a sentiment I see sometimes, that 'Humanity doesn't deserve to go to the stars, because humans are somehow bad', or that 'Humans will just ruin space like they ruined earth.'
I find this to be a peculiar moral argument. It's worth remembering that space colonization is not just about the preservation of humans, it's about the preservation of four billion years of evolutionary history.
Life, I think almost certainly exists elsewhere in the universe. Our particular brand of life (with its nucleotide, genes and evolutionary lineage) is almost certainly unique. And I think denying 4 billion years worth of unique life the chance to survive the death of its host star because 'some humans are sometimes bad', would be a crime.