Capitalism is the problem for the working class that motivates unions as a mitigation.
Its terribly inefficient when compared against idyllic, abstract notions of societies, where resources are distributed and used with perfect efficiency. But so is every other practical alternative.