He saw capitalism as a natural and necessary step before developing communism.
Hence why most criticism of soviet and Chinese communism is fundamentally flawed, since they tried to develop communism in feudal societies.
FWIW I am libertarian leaning, but it is obvious to me capitalism has obvious defects that must be either compensated for, or be done away with entirely.
Not to fall into the "communism is when free stuff" trope, but...
Most people like public schools, public roads, public transit, public parks, and public libraries.
The benefits of public goods are well known. This is the whole field of public finance economics.
Market failures are also well-known. Negative externalities, moral hazard, adverse selection etc. Hence carbon taxes, congestion charges, and universal healthcare.
In other words, sometimes free trade capitalism works, other times it doesn't, and it's not a mystery when. Marx's whole spiel about contradictions is wrong and largely throws the baby out with the bath water, so to speak.
As for Marx "spiel about contradictions", all he did was take capitalists seriously on the notion that competition in a truly free market will tend to drive down margins once the market is fully exploited.
One can certainly disagree with his conclusions over the consequences of that - e.g. whether societies will succeed in continuing to mitigate the negative effects, or end up in crises, but the core theory of Marx on capitalism was that competition and markets works as advertised.
And by socialist system with a free market do you mean one where private ownership of the modes of production remains legal, but simply isn't chosen, or do you consider banning private ownership compatible with free markets?
I would consider public ownership but not state ownership compatible with free markets. The only essential element for free markets is competition with sufficiently low regulation. Some socialist ideologies are inherently incompatible with markets, some are not. E.g. libertarian Marxism and other form of libterian socialism are, because they reject centralised government entirely.