Moses represents organized religion. In the context and discourses of communism, organized religion has been described by Karl Marx as one of the opiates of the masses. It is a part of the social structure which people (or the animals in Animal Farm) have created. For Marx, religion is the illusion of happiness. It is created as a moral justification for suffering in the world, either as God's will or as a necessary suffering en route to a blissful afterlife in heaven. Calling it an opiate, Marx meant that it was a brainwashing technique like drugging people to believe in this illusion of happiness.
When Moses returns in Chapter 9, the animals' lives are much worse than when the Rebellion first succeeded.
Their lives now, they reasoned, were hungry and laborious; was it not right and just that a better world should exist somewhere else? A thing that was difficult to determine was the attitude of the pigs towards Moses. They all declared contemptuously that his stories about Sugarcandy Mountain were lies, and yet they allowed him to remain on the farm, not working, with an allowance of a gill of beer a day.
The pigs allowed Moses to stay on the farm because he gave the animals some hope (even though it was false hope). Moses gave them the illusion of happiness and this could be used by the pigs as a tool to distract the animals from their harsh working conditions.