Ummm sort of.
The government has always spent a lot of money on basic R&D that had no direct applicability to profits.
There are large companies that do basic R&D even so, most of that is oriented towards their particular niche.
There are exceptions of course. Having a government program focused on a particular problem when well funded can, and has frequently, produced good results and unexpected benefits.
Think the Moon landing projects. They produced much of the miniaturization in electronics that led to where we are now.
Frequently it is government spending that goes to for profit companies that allows them to bring ideas to fruition. Think DARPA, NASA, etc.