Its not the stock market per se. The biggest problem is a lack of good regulation to ensure competition and the resulting drift of oligopolies.
The stockmarket enables that by making takeovers easier as you have a higher proportion of short termist shareholders who 1) fail to block value destroying acquisitions on one side and 2) jump at the chance to make a quick profit on the other.