An allegory is
an extended metaphor in which a person, abstract idea, or event stands for itself and for something else. It usually involves moral or spiritual concepts which are more significant than the actual narrative.
George Orwell spent much of his childhood in situations that made him acutely aware of his lower economic class upbringing. His first employment as an adult placed him in the position of being one of the oppressors, working as a British policeman enforcing British colonial laws upon the native population in Burma. He was repelled by this situation and resigned.
Out of the army, Orwell chose to live in one of the poorer areas of London, and then in a lower-class area of Paris. Through all these experiences, he came to accept that his strength was writing about the political situations around him. In 1946, the year after the publication of Animal Farm, he wrote,
every line of serious work that I have written since 1936 has been written, directly or indirectly, against totalitarianism and/or democratic socialism, as I understand it.
Following that driving philosophy, Animal Farm was Orwell's indictment of developments he observed in the replacement of the oppression by the Russian tzars with the communist totalitarianism of Joseph Stalin and related issues. Making his story an allegory, using different types of animals to represent various groups and presenting the hardships as struggles to build a windmill and how to achieve the proclaimed goal of equality for those with two legs and four legs, feathers and fur, allowed Orwell to express his viewpoints while also presenting an interesting story for those who chose to not infer any deeper significance to the characters and actions.
Orwell felt that the allegory was the most effective means for expressing his interpretation of what had happened in a format that would be widely read.