Here’s Marx on capitalism’s role in preparing the material basis for socialism by imposing a transitory historical period of “production for production’s sake” (from section 3 of chapter 24 of Capital):
“Except as personified capital, the capitalist has no historical value, and no right to that historical existence, which, to use an expression of the witty Lichnowsky, “hasn’t got no date.” And so far only is the necessity for his own transitory existence implied in the transitory necessity for the capitalist mode of production. But, so far as he is personified capital, it is not values in use and the enjoyment of them, but exchange-value and its augmentation, that spur him into action. Fanatically bent on making value expand itself, he ruthlessly forces the human race to produce for production’s sake; he thus forces the development of the productive powers of society, and creates those material conditions, which alone can form the real basis of a higher form of society, a society in which the full and free development of every individual forms the ruling principle.”
Fortunately capitalism has already done this and there is no more need for “production for production’s sake.” Unfortunately it continues, causing all sorts of unnecessary problems.
Socialists say that it’s been long overdue to stop this and for the humans race to enjoy the benefits of the sacrifices imposed on them by capitalism, by going over to a “higher form of society” where there can be “production for consumption’s sake,” which is only possible on the basis of the common ownership of the Earth’s natural and industrial resources.