We spend vastly more on projects on Earth, any way you measure. Time, money, manpower. The US Federal Govt spent $6.9 Trillion last year, Nasa's budget was $25 billion, so about 0.3% of spending.
"An estimated 63,600 deaths were attributable to air pollution in the United States in 2021."
0.3% means 190 lives were lost because we prioritize moon toys over cleaning our own environment.