To understand why Orwell wrote Animal Farm as an allegory, it is useful to look at his explanation in the Preface to the Ukrainian Edition in which he outlines two key reasons.
Firstly, Orwell states that he felt compelled to tell the world about the horrors being committed by Stalin in the USSR:
"It was of the utmost importance to me that people in western Europe should see the Soviet regime for what it really was."
For Orwell, Stalin's politics were so far removed from true Socialism that he wanted to tell the world about it.
Secondly, he wanted to portray this story in a way which made it easy for people to understand:
"I thought of exposing the Soviet myth in a story that could be easily understood by almost anyone and which could be easily translated into other languages."
The inspiration for a farmyard came a short time later when he saw a little boy, aged around ten years old, driving a "huge cart-horse" and whipping it "whenever he tried to turn." It suddenly occurred to Orwell that if this animal realised its strength, it could easily overpower the boy and the rest of our society. From this, Animal Farm was born.
To read the Preface in full, please see the first reference link provided.
On one level, Orwell wanted to write a fable that could be enjoyed by people of all ages and situations. By using animals as characters for the story, he was following the pattern of many previous writers of fables, dating all the way back to Aesop. Other characteristics of the story also follow the traditional format used in telling fables.
On a deeper level, Orwell wanted to express his condemnation of the rise to power of the Soviets and the evils he saw in the leadership of the Communist Party. The book was written during World War II, at which time England was an ally of the Soviet Union against Germany, so a book condemning the Soviet Union was a politically unpopular thing to write. The book was not published until after the War in Europe had been concluded.
In an allegory, characters and events stand for something else. In this case, the characters in the novel stand for significant figures in twentieth-century Russian history.
By presenting his story as an allegory, Orwell was able to highlight actions, attitudes, and characteristics of the historic figures he was portraying without directly identifying any of those people. He presented the story and allowed the readers to draw their own conclusions and find their own lessons - the ultimate purpose of an allegorical story.
It allows for the author to give the reader additional information based on the readers level of ability.