“That money could be spent on real problems here!” We solve real problems here via science and engineering, both of which are advanced by space exploration.
Nobody is starving because we have a space program. People are starving because we have billionaires.