At least the stock market is supposed to have a purpose besides gambling, to raise investment for companies. (Whether it's actually successful at that is a separate matter.) And anyways, your scenario would probably be considered insider trading, and that's already banned.