Much of what they do is necessary in order to kill a pig. They tried individual hunting early in their stay but did not succeed. Jack quickly learns where to find pigs, how to sneak up on them, and where their favorite places are. The first pig they kill is done by using a large circle of boys that slowly close in on the pig until they are tight enough to make the kill. The pig had nowhere to go (something we see later in the novel also with the hunting of Ralph). Obviously the chanting and dancing after the kill certainly isn't necessary, but it would sure be fun for a group of 12 year old boys.
With the next kill, Jack decides to sacrifice the head of the pig to the beast in order to keep the beast away from his tribemates. Again, we know that it's not necessary because we're privy to extra knowledge about the beast. Do the kids think it's necessary? Maybe....but again, necessary or not it would sure be fun.
Remember that these boys are away from any adult supervision and rules. Most of what they do on this island would be frowned upon and/or punished by authority figures at home. So even if dancing and chanting and sacrificing isn't necessary, the boys would do these things simply because they can.