I occasionally see people claim that socialism is an ideal system that is held back by selfish people. That's not the only reason it fails, and even if people were as selfless as socialists like to pretend they are (or somehow would be under socialism, at any rate), it still wouldn't work.
A big part of this is the problem of calculating opportunity cost. Capitalists pushing capital toward whatever is making an economic profit, and firms producing goods until the marginal cost of production is equal to the price, create a system where the opportunity cost of production and the opportunity cost of consumption are quite similar, and this is indicated by prices. Consumers ultimately direct resources according to their own preferences, and those preferences end up taking the opportunity cost of production into account even though the consumers are only concerned with the opportunity cost of consuming one good rather than another. Any system without capital markets and profit-seeking firms loses this functionality, as does any system where prices are set by any other method.
Now, some firms are able to wring a little extra money out of things by virtue of market power giving them a profit-maximizing level of production that is reached before they hit the point where price equals marginal cost, but this is actually a pretty small thing. The average net profit margin across all industries is only 8%. What this means is that while there is some wiggle room, it's accurate enough to work well.
Under socialism, you do not and cannot know the opportunity cost of production. Whether you've got the central-planning style of socialism or some kind of democratically controlled system makes no difference; the mechanism that allows us to discover the opportunity costs of production is born of the interaction between capital markets and profit-seeking firms.