For the organizations and countries involved, this helps provide for an advanced industrial base that continues to build and drive an ecosystem that supports powerful economic engines.
Another major reason governments fund research is to produce people with PhDs. This is why the apprenticeship structure of academia is so sticky, and why in order to get tenure professors have to graduate students.
Unless they don't mind working for peanuts, in which case there's no problem.
1. Society uses price signals to drive activity to areas "we" want to develop
2. In research, the tournament model prevails so a few winners get most of the gains
However, the question arises:
The tournament model prevails in many other domains including startups, the movie industry and so forth. However, in those areas most people don't feel that the enterprise is severely underfunded. (I am assuming this so if people have contrary data, I will re-assess).
The question stands: in spite of the tournament model, why does society fail to deliver enough reward for basic research when we as a society believe that there should be more of it.
(We could ask the same of teachers, and so on.)
It could also be the case that "society", whatever that is, doesn't really feel that science is underfunded.
Repeat for grad school->postdoc, postdoc->tenure track, and so on.
I honestly think that the lack of large industrial research labs and the drying up of good academic research positions is very much an issue of what would be R&D funding going to other things that provide better near term ROI: VC, stock market, etc.
R&D is very much an investment like anything else and for whatever reason (patents, existing IP portfolios, etc.), it's just not a place that gets much attention at the moment as the money handlers have found that they have more ROI opportunity elsewhere.
I think the modern substitute for old fashioned R&D is the modern tech startup. The siren call of these ridiculously inflated "valuations" is simply too much for investment managers and it locks up more and more money that could go towards other investments. There's more parallels there as well, R&D and Startup investment is a high-failure game. But the outcome of successful startups is likely to be much larger than the outcome of a successful R&D venture (which still has very long tails of IP capture, product development, marketing, etc.)
I think it's a shame in the sense that, while we end up with dozens of photo sharing sites and social network startups, there's very few actual world changing ones out there. Most of what we get are not "hard" technical areas and their value derives from their faddish popularity - they're kind of the Karashians of technology.
But I guess that's the way of the world.