In Animal Farm, the revolution fails because its emphasis on equality and community is destroyed by Napoleon's self-interest and desire for power. To demonstrate this, take a look at the difference between Chapter Two and Chapter Ten. In Chapter Two, for instance, the animals are united by the Seven Commandments, which vilifies humans and makes all animals equal. But, by Chapter Ten, there is a clear difference in the farm's ideology. The Commandments are whittled down to a single rule: that some animals are more equal than others. In other words, the pigs, especially Napoleon, are the most important individuals on the farm and their needs and desires supersede all others.
By creating this distinction between the pigs and the other animals, the revolution has lost its founding principles. Moreover, the closing image of the novel shows the pigs (who once loathed Mr. Jones) dressed in human clothes and walking on two legs. They became the people they hated because their ambition—and not the common good—became the revolution's driving force.
The major reason why the revolution fails on the farm has to do with the way that the principles and ideals of the revolution itself were subverted by those who rose to power, particularly Napoleon. At the beginning, the seven commandments were at the heart of the decisions that were made and the animals felt they had gained some control over their destiny once they turned out Farmer Jones.
But once Old Major dies, the care of the revolution and the leadership of the animals falls to Napoleon, Snowball and Squealer. While Snowball has the interests of the other animals at heart and works to pursue those ideals, Napoleon quickly begins to take advantage of his power using Squealer to twist the truth and the dogs to attack those who dare to resist his subversion of the ideals of the revolution.
By the end of the book, Napoleon and the pigs act exactly like Farmer Jones, showing no concern for the welfare or interests of the other animals. He and his henchmen break all of the seven commandments but by twisting the truth as they see fit and using force to stop any major objection, they get away with it.