Capitalism certainly lowered life expectancy initially, Marx makes this abundantly clear in Capital - Volume 1. However, with industrialization came advancements in socialized production (not socialist, socialized, ie cooperative work on an expanded and industrial scale in capitalism), which allowed for an acceleration of the sciences. Feudalism was holding science back, which in turn held medical science back. Same with farming, industrial farming increased outputs dramatically.
The Soviet Union and PRC absolutely made more dramatic improvements on a far-shorter time scale thanks to socialism, and indeed they did not rely on a developed period of capitalism (though they still depended on market forces), but the proletarian ideology of Marxism could not have come to existence without the prevalence of capitalism somewhere, this case being western Europe, allowing Marx to make critical advancements and Lenin to analyze the impacts on imperialism to successfully lead a revolution.
Feudalism was more obviously exploitative, and to a lesser extent than capitalism's theft of surplus value, but the sheer productive capacity of market forces ultimately provided the base for class struggle and development of proletarian ideology.
Capital, Volume 1 was first published in 1867, when capitalism was dominant in western Europe and it was both dramatically improving production while pushing down the quality of life of the proletariat. Capital is a critique of "Political Economy," the common bourgeois justification for capitalism. Marx's chief observation about capitalism that enables socialism is capitalism's centralizing tendencies, which increases the ratio of proletarian to bourgeois, while also training the proletariat on how to run and administer a complex and centralized economy.
The old, tribal formations were not socialist, they had no socialized production. It was cooperative, but extremely small-scale. Feudalism did not pave the way for socialism, either, but instead gave birth to capitalism. Capitalism's centralization and introduction of large, industrial production does give way to a large, single class that can collectively run and plan production, ie socialism. From Manifesto of the Communist Party:
Communism has not stopped blooming. Or, rather, it hasn't started, either. Communism is a future system of fully collectivized, classless production. Socialism is still thriving, of course, it's the form of economy of the PRC, Cuba, Vietnam, etc.
Tell me, what should I read of Marx that goes against the theory of historical materialism and scientific socialism?
One more, for good measure, from Draft of a Communist Confession of Faith: