That’s not how stocks worked for most of the past century. People did not buy stocks expecting them to go up in value - perhaps keep pace with inflation, but that’s not how you made money on stocks. You bought stocks, which gave you ownership in a company, and those stocks then paid dividends, your share of the profits for investing in the company. That’s what stocks were supposed to be about and why they were allowed. You could then sell the shares, because their inherent value was the future dividends of those stocks, i.e., the future ability of that company to generate profit/dividends.
The way it is now, it’s just gambling and adds no value to the economy, except for those few stocks that still pay a decent dividend.