In an interview, Foucault explains what he wants from Marx:
“What I desire—and it is here that my formulation has changed in relation to the one you cited—is not so much the defalsification and restitution of a true Marx, but the unburdening and liberation of Marx in relation to party dogma, which has constrained it, touted it and brandished it for so long.” [Emphasis added]
(Source: Foucault, Michel. Politics, Philosophy, Culture: Interviews and Other Writings 1977-1984, New York: Routledge, 1988, p. 45)
Related: Explaining Postmodernism: Skepticism and Socialism from Rousseau to Foucault.
It’s funny that Foucault was actually published in Soviet Union. The Order of Things was published there in 1977, though it was only available for scientific libraries, hence only trained marxist philosophers and similar people would be able to read it.
I also recently read an old Soviet book (1984) critisicing the New Philosophers movement in France. While this movement is heaviliy criticized as being bourgeois, reactionary, banal, etc., Foucault in the same book is described quite positively.
Marxism is a failed system. It obviously doesn’t work. WHY do people continue to pursue it. The carcasses of failed Marxist states lie scattered across history like the bodies of a war. Socialism is no more functional than fascism. Both fall into corruption and fail when they destroy the poor and the middle class while enriching the few. Typically, impoverishing those they swore to protect.