To me, the deaths of the two boys show very clearly two very negative aspects of human nature. I believe that Golding is trying to bring those out by the ways in which the two die.
Simon dies because people fear what they do not understand. The whole idea of the beast is something they have made up for themselves to personify their fear of the unknown. When they kill Simon, they do it blindly, out of fear that he is the beast.
Piggy dies because people are power hungry and selfish. He dies in a dispute over power and over whether there should be rules to regulate people's behavior.
So each boy dies for a different reason, but both deaths show very negative aspects of human nature.
In the book "The Lord of the Flies" the two boys represent different symbols. Simon is Christ like and symbolizes purity. Piggy is civilization and order.
The first death occurs after the boys have become wound up. They are chanting and reverting to savage nature. They are so into the moment that when they see Simon they only see the beast. Even when they have him down on the ground, they continue to bite, beat, and claw at him. His death is supposed to have been an accident, but he dies savagely.
The second death is Piggy's death. By this time the boys have transgressed into the state of savage. Roger no longer practices the laws of civilization. With no boundaries and laws, he has nothing to stop him from deliberately leveling the rock onto Piggy and killing him. His actions symbolize the total breakdown of civilization.