Over time, you're going to make money in the stock market. (That says nothing at all about individual stocks.)
Over time, you're going to lose money gambling. (That says nothing at all about what the next roll of the dice will be.) This is why casinos prosper.
Of course, if the US gets into nukular combat toe-to-toe with the Russkies, your stocks will likely vaporize to zero. But you'll be vaporized as well, so it's a risk not worth worrying about.
Less extreme, if the US goes hard into socialism, the stock market is not going to prosper. But your other investments won't prosper, either, so again that risk is not worth worrying about.
Gambling is when the rate of return (over time) is negative.
Investing is when the rate of return (over time) is positive.