The killing of Piggy was really just the next step in the progression of their violent dance ritual. Originally, the dance began as a way for the boys to rally their courage enough to kill a pig. After they kill their initial pig, they add a chant to their dance. After killing more pigs, they add actions to their dance and chant including using a boy as their pig inside their dancing circle. Eventually, the boy used inside the circle is able to recognize how physical and violent this ritual is becoming as the boys get carried away by the fun of pretending to be savages. This continues to escalate until the scene at Castle Rock when Piggy is killed. By this time, the boys are painted up, have established guards and defenses at their "fort", and treat Jack like a general. It's like little boys playing war with plastic soldiers and cardboard boxes in the basement; except these boys have real people and a real fort to play with.
This is why Ralph's leadership was so unpopular. Ralph was overly concerned about practical issues like shelter and fire for rescue. Those tasks were too much like work for the boys. Jack offered a tribe where hunting, savagery and fun were emphasized. The boys were so hung up in this, that even the blatant killing of Piggy no longer deterred them.