Stock markets do a number of valuable things:
However, they also do some less valuable things:
Most importantly, however, from a socialist or republican perspective, ownership of companies being up for sale means that constrol of institutions are up for sale (and firms are among our most important institutions.) To have stocks for sale means a separation between workers and ownership.
Many features of stock markets - most especially, their ability to marshall large resources - can be taken over by central planners or by other non-market instiututions. However, the ability of bourses and other markets to gather tacit information is likely greater than any non-distributed planning body could achieve; in particular, they give researchers an incentive to place bets (and hence reveal information about) which enterprises are likely to be producing desired goods in the future, over and above the data that come from e.g. sales numbers.
There's another kind of market that does this - the prediction market! Here, market participants *directly* bet on what is going to happen, rather than implicitly betting that the price of something will go up (as in purchasing something) or that it will go down (as in short-selling it.) This would allow individuals and whole firms of analysts to gather tacit information on likely company success without gaining claims over firm earnings or firm behavior.
Current prediction markets are kind of small and crappy. But if there were no stock markets, and there were a bit of subsidies to prediction markets - and if some current arbitrary barriers to prediction markets such as silly gambling ones were removed - then they would likely marshall many of the current analytic resources that stock markets do.
Currently I've mostly seen right anarchists and other right-liberals showing the most interest in prediction markets, which on one level makes sense - they are the people most straightforwardly excited by doing things by markets - but their model of society is one that already has large and successful (as far as things go) institutions doing sommething similar. Since they can do many of the things stock markets do without requiring capital/labor separation, I think at least those subset of socialists who are comfortable with some markets (most notably mutualists but also most democratic socialists... and even planned economies had monopolistic consumer goods markets) should be excited by them.
Such markets could allow 1) cooperatives to release the equivalent of an "IPO" (betting pool on future success) that people could bet on, providing information to crowds or determining how much money e.g. sovereign wealth funds direct towards them 2) the state-planned sector of the economy, if any, to make decisions conditional on betting pools.