They do in many instances. A lot of fundamental science is funded by tax dollars. I personally think that's a good thing. But I don't think that needs to be the only avenue.
A lot of culture is supported by the government in many countries, and a lot of private investors don't even see a break even with their productions, let alone any profit.
Profit comes from useful things. People wanting to buy your thing is a much better signal as to what's a good thing to work on than a bureaucrat's inkling.
The problem is that many 'useful things' are predicated on past discoveries that weren't particularly useful at the time they were made. That's why government (an organization with a particularly large risk tolerance) is a good mechanism for paying for fundamental science. I think the dichotomous thinking of public/private is more harmful than helpful.
You're introducing that dichotomy right now. And you're forgetting the millions of advances that happen in private companies to push forward the state of the art. Look at Tesla, or SpaceX, or Hitachi, or BMW, or Microsoft, or IBM, or Xerox, or Astra Zeneca. Incredible advances happening all over, sometimes not realisable for decades, but occasionally commercialised and rolled out if it's beneficial to enough people for the cost.
It's funny you brought up SpaceX because that's one of the examples I was going to use for my previous comment. SpaceX's early work was almost exclusively funded by government contracts (which they could then use to borrow against). Musk himself said they were down to the 11th hour of bankruptcy before NASA 'saved' them. Their SpaceAct agreement also gives them the benefit of NASA's past science; they aren't starting from square-one, which is part of the point. The SpaceX business model follows that of many nascent industries: rely on the government with its extraordinary tolerance for risk until they prove themselves viable enough to get private customers that are generally more risk adverse. Aerospace is a prime example, dating back to the Wright brothers. The govt provided a lucrative military contract as a carrot that transformed the space from hobbyist to a legitimate industry.
And that's what I'm saying. I'm not introducing a dichotomy but you may not understand the point. In a hybrid model, high-risk ventures are funded by the government because there are few comparable entities that can shoulder that risk burden. Once the industry proves itself, it opens itself up to more private ventures. The government funds and sets goals, and the private sector innovates and delivers. That's not a dichotomy and most of the examples you provide that I'm familiar with support that model. I'm not denigrating private or public pathways, just acknowledging each have aspects that can compliment the other.
People often buy things even if there are better free alternatives because they don't know any better. Otherwise nobody would be using the utter garbage that is Microsoft Teams, for example.
Yes, it's not a perfect signal. It just beats a bureaucrat guessing.
Ironically of course, Teams comes free with most corporate licences. You have to pay more to use alternatives, but the IT bureaucrats have deemed it was best for you. The reason alternatives exist is they're worth paying for.