It's a much bigger topic than I admit to knowing the full depth of, but a few problems include:
Things like speculation, where a stock is valued, not at it's current actual value, but at a perceived future value, which may or may not actually pan out and gets dangerously close to simple gambling.
Things like high speed automated trading which take advantage of very small price changes to make profits, but also end up having no human in the loop to sanity check and have caused things like massive market crashes in the past. (Luckily they tend to recover fairly quickly on a market-wide scale, sometimes within seconds, but I imagine individuals have gotten severely screwed because of them.)
Things like where companies exist simply to artificially inflate their stock price and then sell the company off with little to no actual productive value for existing. The classic example being tech/single product startups that manage to sell stock based off of an idea that never actually makes it to market, and some people end up walking away with money, but many others end up losing their investments.
There's nothing wrong with the idea of selling stock on a publicly traded market. It's a good way to raise capital for a company that needs outside funds to grow or try something new. The problem is simply that it's gotten out of hand and there's little regulation, and even where regulation exists, it rarely gets enforced except in the most egregious of circumstances. And it seems like every time a regulation does get put in place because of something that happened that caused major damage, then the financial people simply manage to figure out some way to do the same thing again, just with a few extra steps involved that put a buffer between the thing they want to do and the thing they're allowed to do. It's simply become a way for people with a lot of money to print even more money, and anyone without a few billion involved is just along for the ride, for better or worse, and nobody with authority is willing to say "enough is enough."