SpaceX wouldn't exist without NASA sinking a lot of money into very risky R&D and training up a whole fleet of engineers capable of doing the work that SpaceX does. The public sector can be insanely bloated and slow - that's quite true - but it's necessary and contributes a lot to society that the private sector would never deliver.
We need balance in all things.