Public funds for research is a tiny fraction of the funds that the government spends. There are trillions wasted elsewhere that shows that overall it is terrible with spending money productively.
Yeah yeah, SpaceX exists now, decades after all the very tough and very expensive initial work.
Imagine how much more we could have now if the space program budget was more than a fraction of a percent. That won't be fixed by just giving more money to the govt.