"The thing is, the S&P 500 is clearly hugely profitable, so why doesn't the government invest in a wide shotgun approach to fund half (or more) of the entire S&P 500 and in return take half (or more) of the profits to either keep as revenue or reinvest in the S&P 500 or in other stock indexes?"
Gov't investment in any industry just because it's profitable is a bad idea for obvious reasons.