That's a ridiculous attitude. You could use the same logic to say we should ignore our problems with income inequality until we solve global warming, or vice versa. It turns out there are billions of people on earth with a wide variety of skills and we can do a lot in parallel.
At its peak NASA used 4.41% of the federal budget. In 2014 it was 0.5%. We can afford to do more and as we know from experience the payoff is worth the expense.
Well earlier in this thread I heard someone talk about spending money on the moon instead of wars. We all have our own priority order (or partial order perhaps) for how we'd like public money to be spent.
In US history (see, e.g. 'A History of the American People', Johnson), environmental, economic, and social problems were often solved by moving in to new territory. If you can think of the Moon as the Eighth continent, it may well be how we solve our present, pressing environmental, economic and social problems.