I took it as more an anti-authoritarian story than purely anti-capitalist or anti-communist. The anti-capitalist parts are fairly self-evident, at least to me: that's the rather brutal system the farmer has imposed on the animals at the start.
Booting the farmer out and starting again with the animal-owned collective sets the story up for the real message, which is that power corrupts and it is very easy for anyone attracted to power to co-opt legitimate grievance for their own ends. The return of the farmer brings a nice circularity to the story as well as giving the idea that the imposition of will on others is usually to their detriment. Capitalism or communism are basically indistinguishable to everyone existing without power or influence.