Now it is the official ideology in only five countries, and even there it is mainly an excuse for authoritarian rule, not a real belief system.
But the principle of equality remains a central value in human politics, and now we sort of know why.
Egalitarianism among human beings poses a problem that cultural anthropologist Bruce Knauft dubbed the "U-shaped curve".
He observed that all non-human primate species – chimpanzees, gorillas etc — are intensely hierarchical (a vertical line), whereas for up to 100,000 years before the rise of civilisation, our hunter-gatherer ancestors were extremely egalitarian (a horizontal line).
But as soon as mass civilisations arise five thousand years ago, it's back to chimpanzee values. Until quite recently, all civilised societies were steep hierarchies of privilege and power. So draw another vertical line, and you have the U-shaped curve.
This raises two questions: How did human beings break away from the primate norm, and why did they succumb to it again as soon as they became "civilised"?
The best answer to the first question came from another anthropologist, Christopher Boehm, who pointed out that humans were intelligent enough to realise that the usual primate dominance struggle among all the adult males could only have one winner.
Everybody else was bound to lose, and to be bullied and dominated by the dominant male. Since each individual was far more likely to lose than to win, it was in their collective interest to shut the whole dominance game down – and unlike other primates, humans had language, which enabled them to conspire in mini-revolutions that achieved exactly that goal.
All of those little hunter-gatherer societies were egalitarian because they were, in Boehm's phrase, "reverse dominance hierarchies" — the rank and file got together and overawed the would-be alphas.
Even today the customs of aboriginal societies reflect this old revolution: they are fiercely egalitarian, and have strong social mechanisms for taking down those who are getting too big for their boots.
Human beings lived in tiny bands with no hierarchies, not even any formal leaders, for long enough to entrench those egalitarian values in our cultures and maybe in our genes.
But even the earliest civilisations had many thousands of people, which disabled all the social control mechanisms that relied on spotting and discouraging the would-be alphas. Moreover, mass societies had complicated economies that needed centralised decision-making.
So the alphas took charge, and the millennia of tyranny began, and it only ended in the past couple of centuries when democratic revolutions started to overthrow the kings, emperors and dictators. Why now?
Probably because the rise of mass media (just printing, plus mass literacy, in the early phase) gave the millions back their ability to organise, and to challenge those who ruled over them.
They were still egalitarians at heart, so they seized the opportunity. and by now more than half the world's people live in countries that are more or less democratic.
But it's only political equality — we never got the material equality of the hunter-gatherers back, and the social hierarchies persist.
Marx's goal was to reconquer the remaining lost ground (though he would never have put it like that), and create a classless society that lived in absolute equality. It was such an attractive goal that millions sacrificed their lives for it, but it was a pipe-dream.
The only way to achieve that kind of equality again in a modern mass society was by strict social controls – and the only people who could enforce those controls were ruthless dictators. So we learned something from the collapse of communism — absolute equality comes at too high a price.
But too much inequality also exacts a price. People living in modern democratic societies will accept quite a lot of inequality — especially if there is a well-developed welfare state to protect the poor — but if the income differences get too great, the politics gets ugly.
Why did Canadians elect Justin Trudeau as prime minister, while Americans chose Donald Trump as president?
The two countries have similar cultures and almost identical per capita incomes, but the richest 20 per cent of Canadians earn 5.5 times as much as the poorest 20 per cent – whereas the richest fifth of Americans earn 8 times as much as the poorest fifth.
Inequality is inevitable, but you have to manage it.
Gwynne Dyer's new book, Growing Pains: The Future of Democracy (and Work), was published last month by Scribe in Australia, New Zealand, the United States, Canada, and the United Kingdom.