1) Learning about the Universe
2) A technology breeder
3) So that scientists can say "Told you so" when one of the discovered cosmic-based threats, such as an asteroid or CME, screws over civilization. Sure they can warn about these threats with the hope of generating actions to mitigate the threats, but usually if it is something that won't kill everyone in the next week, it's of no concern whatsoever.
This.
And $17b is hardly anything more than chump change as far as government spending goes. NASA continually gets screwed with funding, because of the ongoing opinion that space research is unnecessary.
The technological advancements that come from NASA research are incredibly helpful, and the potential progress for our species is absolutely necessary.
If it weren't for the weapons potential from scientific research, I'd propose all countries that devote funding for astronomical research to work together under a single banner for progress. Regardless of the potential ramifications I still say to do that, but because scientific research can prove deadly, it wouldn't be a popular idea at this point in time.
But we're not really getting anywhere with multiple countries spending a decent amount of money researching essentially the same things, all reaching for the game goals. Why not spare the unnecessary repeats and redundancy and ignore the whole concept of State progress propaganda. Again, not exactly an idea shared by many, but the way we conduct things right now is comically retarded, and depressing at the same time.
But the pressing need for space research is always combated by the age-old wisdom of man - it's not a concern we need to deal with right now, so why bother? Let future generations deal with it as the situation becomes more dire. Hmmm, excellent idea.
We need to get off this rock at some point in time, or mankind's progress will be forever wiped clean. We'll have a fresh start, if any of us survive, but an unnecessary loss of hundreds of generations worth of knowledge most likely.
I say reach far now, so our chances are better in the future. We're gonna need parity at some point, can't have all of our eggs on one planet.
And even then, a lot of relatively immediate pressing concerns are energy sources beyond Earth, and threats nearby. NASA has got the right idea right now with investing quite a bit into studying the Sun, as severe solar weather doesn't play nice with technology, and they want to figure out how to prevent massive damage.