Governments fund cures and vaccines for disease. Private companies don't work on cures, which is why the last things we've cured is polio, which was developed by an NIH-funded university researcher; and widespread famine through much of the developing world, by crop breeding and fertilizer research led by Norman Borlaug and the US and Mexican government.
your flawed assumption is that private companies are the only funding source. What about non-profit researcher foundations, such as HHMI? What you haven't seen is that in the past decade or two these foundations have been whittled away by the growing government behemoth. It used to be that every other graduate student was on some private grant or another, but now they are all written on RO1 NIH grants. With inflation eroding away at research endowments and faster-than-inflation growth in most laboratory equipment prices, a private research grant supplies maybe $100k a year, which is now insufficient to pay for even a research associate $50k + benefits, plus equipment. Plus, NIH gives research institutes "overhead" which is negotiated on a per-unit basis with each institute. So greedy-ass research institutes are not inclined to even allow their researchers to apply for grants which don't permit overhead.
When you have a line to an apparently unlimited line of credit, the practices are going to be wasteful because of perverse incentives (at the NIH they have glassware-breaking parties at the end of spending cycles to use up their budget because if they come underbudget they are at risk of having it reduced) and you are going squeeze out private (non-profit) competition.
How about a cure for cancer? Vaccines against HIV, influenza, etc? Tissue bioreactors that grow organs? Postpone aging?
Sure, there is a lot of esoteric stuff being done. Catfish genomics, characterizing motor proteins of archaea, etc. I can't speak for every research team or every goal. Yes, we could better coordinate and collectively strive for greater human societal objectives. But then a lot of feet would get stepped on. Who knows if some "pointless" research project may wind up saving us?
The apollo/manhattan approach that government tends toward doesn't seem a very good way to do research. In 1971 Nixon started a "war" on cancer, hundreds of billions of dollars have been spent. That's mis-allocated money because of the centralized, targeted management of aims. I'd prefer to see hundreds of thousands---or millions---of small, subsistence grants for esoteric stuff than few big-ass, centrally administered "wars". The same dollars directed by a substantially larger group of recipients would better cover problem & solution spaces.