When stock markets are high, the government receives a lot of tax revenues. There is a very high correlation here. That's also why the government can't let stocks go down in value, because that would mean their tax revenues would decline.
The result is that deficits would go up (red chart down) as tax revenues decline (blue chart down). So it would be a nightmare to have a strenghthening dollar (higher debt load), with declining stock markets (lower tax revenue), because that would spiral into a government default.