One of my favourite scientists of all-time is Harrison Brown. He was most known for his role in launching George Tilton and Clair Patterson's dating-the-Earth project. But he had a most amazing ability to convince the cold-war era US government to fund civilian science that had no real military value whatsoever. He was a kind of science-funding Robin Hood, an ethical con artist.
This might be a bit of a tangent, but the US is still at war and has been (in various stages of "hotness") for many decades). The war in Afghanistan will turn 18 in less than 2 months. More on-topic -- quite a bit of research still gets funding from the military, because of their massive budget (not that I think that this is an overall good thing -- I've heard really worrying stories about the sorts of discussions you have when doing military-funded research).
It is tricky to figure out how to allocate funds, but software underlies our nation's infrastructure, too. Having federal grants for the maintenance of core open-source infrastructure sure sounds like a cheap investment to me.