It was homage to the beast and this, being the Lord of the Flies later, is related to the devil. Lord of the flies in Hebrew has a similar name to Beelzebub, which is the devil. It signifies that the devil is all part of us, when he says he is part of them to Simon during one of his seizures.
Chat with our AI personalities
It symbolizes the monstrosity and animalism of everyone on the island, when it was meant to be an offering to the beast. The beast was in all of them.
The lord of the flies originally hung on a stick sharpened at both ends. One end in the earth and the other supporting the pig head. Roger intends to do this same thing to Ralph if they kill him, but replacing the pigs head with Ralphs. They dont kill Ralph :)
At the beginning of chapter 12 Ralph is hiding in the jungle. He comes across the pigs head and takes the stick that is holding up the head to use as a weapon.
Well, they use the first sharpened stick to put the pig's head on. They don't actually do anything with the second stick, but they planned to kill Ralph and stick him on there, just like the Lord of the Flies. Luckily for him, the naval officer came and the suspenseful chase through the woods is ended.
The hunters put the pig's head on a stick because it is a type of gift to the "beast"