That's all because of government de-funding of NASA and billionaires siphoning away so much money from the economy that they have the capital available to start vanity space companies. Even still, SpaceX's biggest commercial success story is Starlink, which could easily be outclassed by terrestrial internet if ISPs bothered, and is a maintenance nightmare that requires launching a whole bunch of satellites every five years or so. The rest of their money is from government contracts which is the continued siphoning of public money into private hands. If NASA was tasked with making reusable rockets, it'd be cheaper in the long run and the public would benefit from shared research, but again, it's intentionally made inefficient for political purposes.
Even with all of these advantages, the vast majority of SpaceX's valuation comes from their AI story, thanks to the AI bubble, which is currently so much of a money drain that it has more than wiped out all profits from their space activities.