Are they not? Why do I believe these are always run by contractors? Is that real life?
They are operated by those contractors for a profit, profiting from the US government. The US government does not choose to establish and/or invest in yards, and grant operating contracts to those contractors, for the purpose of making a profit.
The US government does so in order to have a reliable source of naval construction and repair services in case of a military conflict.