Great question (though it is a bit of a mouthful!).
Rituals often help a community to build a sense of "togetherness." When people all do the same action, in the same way, or at the same time, it makes people feel like they are part of the same group. Think about funerals or weddings, fireworks at fourth of July or the inauguration of the president.
The battle of Cowshed provides the pigs with an opportunity to create rituals that strengthen their "state" (the farm.) The singing of a national anthem, the farm flag, the firing of the rifle, going past Old Major's skull, the awarding of medals...these are all ways that the the new "government" of pigs can get the animals to feel like they are part of a community and also exert control over them (like when they come up with the new anthem and force it on the animals.) The rituals, in the end, solidify the fact that the pigs are in charge and the repetition of the rituals helps drive that fact home to the other animals.