Moses is first introduced as a spy for Jones. He is deployed for the purpose of keeping the animals' minds off of their labor and their toil. In preaching to them about Sugarcandy Mountain, Jones uses Moses to keep the animals in check, telling them that their reward comes in the afterlife and that the purpose of this life is to work towards that end. In doing so, the animals do not feign rebellion because they believe that their struggle now pays off for them later, while in the meantime they are manipulated by those in the position of power to reap the benefits of their work.
While there is no outward evidence of some type of deal brokered between Napoleon and the pigs and Moses, it seems that the same purpose is invoked when Moses comes back and tells the animals again about Sugarcandy Mountain. In this setting, the pigs have become the forces in the position of power who greatly benefit from distracted animals. In this respect, Napoleon sees no problem with Moses preaching to the animals because it prevents any sort of opposition or dissent to his power. Orwell tells us that Moses receives food for his services, implying that he is a tool of Napoleon's power structure and apparatus of control. In the end, Moses' return also indicates how things have changed and not changed. On one hand, there was a time when the pigs led by Snowball and Napoleon actually did not want Moses on the farm because of his preachings of the afterlife. This is certainly not the case at the end of the narrative, as the pigs benefit from Moses' preaching serving as distractions for the other animals. In the end, Moses return indicates how the more things change on the farm, the more they stay the same.