SpaceX is a private company (regardless of how many gov $ it receives) and can’t simply be restructured like a government agency could if it got into serious enough trouble. (Legal, financial, managerial, market, etc.)
Since SpaceX can expose itself to potentially fatal risk (by definition), it is in the government’s national security interests to spread that risk among several companies, regardless of the price tag.
Technically it can, its just that the US government doesnt like to.
It may or may not actually be cheaper to pay both in the long run. On one hand theoretically if they were the only option in the world they could charge absurd amounts. On the other hand it seems they stand to make more in the coming years commoditizing launches to attract more overall customers/launches and charge them each millions than to charge a few customers billions. Also they'll never be the only one in the world but it is a risk they could end up the only commercial venture in the US capable of launching.
One option is medium cost with low risk of astronomical (pun intended) cost and the other a low cost with a medium risk of astronomical cost.