Investing money in the stock market doesn't meaningfully improve the economy. Unless by economy we mean the stock market of course. Sure, if you have run out of better investment options and still have money left over that's a decent strategy (Norway's sovereign wealth fund would be a good example). But usually there are better investments available for governments. Buying goods and services from local companies is one such better investment, since it directly benefits those companies, not just their stock holders and managers