Can't have the moon without the "useless" rocks and dust.not sure why you brought that up.
My answer to your original question would be, some are explorers or adventurers. Others are "stay at homes." So we fund the explorers and the rest can live vicariously or ... complain about the "waste" of money. It all depends on one's perspective I suppose. I've enjoyed many of the new stuff space exploration has generated that contribute to our ease and quality of life.
Plus, we do it because we can and, as observed above, lots of interesting weapons and there delivery systems evolve from the necessary expenditures.
Lastly, lots of moneys make there way into the economy through salaries.