That's the conventional argument for government funded research, but is it true? The AI space is a good example of very long term research, funded almost entirely by the private sector without any clear idea of how the results would be marketed, they publish and - the key part - the work actually replicates. Nor is the AI space unique. XEROX Parc was another famous example, Big Data/Cloud has come entirely out of private sector research. Not unique to computer science either: the research work that led to Ozempic was being funded by Novo Nordisk as far back as 1998.
> Research usually doesn't end in something that's marketable
It usually does, even in academia. That's why they count citations. It's just that the thing that's marketed is either policy advocacy (marketed to governments) or the claims in and of themselves, marketed either to the general public in TED talk style advocacy or to other academics as work they can build on to get more grants. A lot of people don't recognize the existence of things like the profit motive, lobbying or marketing in government funded research, imagining that they don't exist, but they do. In some fields, it's common for lobbying to be like 50% or more of the word count.
There's a long tail of papers that research things that nearly nobody cares about, yet perhaps one day they might. These are the "we studied some obscure fish in the Amazon and found a cure for cancer" type stories that crop up from time to time. But such claims often don't quite work out, and the private sector is easily able to fund this sort of exploratory work too.