Most people won't have heard about most the successful companies that resulted from the combination of military spending and research grants, much less the many failures on the way.
If we knew how to pick the successes ahead of time, there's be no point in gov funding, or in venture capital firms, because they'd be able to go into any mainstream bank and loan finance their entire business with regular business loans.
Government research funding almost inherently should have a high failure rate, because they offer the most value where they enable research that is so high risk they can't get funding elsewhere both because of the occasional big win, but also because of the side effects of creating eco systems.
That's not to say that doesn't also lead to lots of stupid projects getting funded, and lots of mismanaged funding programs that deserve scrutiny. But it's also always easier to recognize the stupidity after the fact...