Sovereign Wealth Funds allow countries to participate in investment markets, and earn money that way. Norway has a Sovereign Wealth Fund that they use to pay for their national retirement program. They can bring millions, if not billions of dollars into the government every year, just through dividends and advantageous trades, all without imposing new taxes.
Personally, I question the ethics of it. Norway can get away with it, because their Sovereign Wealth Fund doesn't invest in Norwegian businesses. The US investing in its own businesses like this is a bit too close to nationalizing them, unless the government can only buy a limited portion of the market cap, and isn't permitted to engage in ownership activities.