Your question relates to the opposition that is present in the novel and which force wins out at the end. The central opposition in the novel is that between the forces of civilisation and savagery, or order and chaos. Golding explores the competing instincts that dwell within us all: to live by rules, obey morals and act for the greater good of society, and then the opposite side, which is the desire to dominate, enforce one's will and act immediately to gratify desires.
This conflict is explored throughout the novel through examining the boys' gradual slide into lawlessness as they adapt to life in a barbaric jungle away from the normal controls on their behaviour (law, parents, school etc). These two forces are represented by the two characters Ralph (civilisation) and Jack (savagery).
Golding's conclusion is that the instinct for savagery wins out in the end. It is far more primal and fundamental to us than the instinct of civilisation, which he sees as a result of social conditioning rather than any moral goodness within humanity. We can see this through the example of the boys: when left to their own devices without any external forces of control, the instincts for savagery win out, even in the defender of civilisation, Ralph. The concept of the innate evil within all of us is central to understanding this novel, and is symbolised by the beast and the sow's head on the stake. This is the realisation that causes Ralph and the other boys to weep at the end of the novel, ironically when they should have been most happy: "Ralph wept for the end of innocence, the darkness of man's heart, and the fall through the air of teh true, wise friend called Piggy." So the "darkness of man's heart" is therefore the central moral of this story.