This paper aims to explain the rise and fall of communism by exploring the interplay between economic incentives and social preferences in different economic systems. We introduce inequality-averse and inefficiency-averse agents responding to economic incentives and transmitting their ideology as they are affected by evolving outcomes. We analyze their conflict through the interaction between leaders with economic power and followers with ideological determination. The socioeconomic dynamics of our model generate a pendulum-like switch from markets to a centrally-planned economy abolishing private ownership, and back to restoring market incentives. The grand experiment of communism is thus characterized to have led to the discovery of a trade-o¤ between equality and efficiency at the scale of alternative economic systems.