Topic summary
Moral code

Extracted from the Wikipedia article Morality.
Evolution
On this view, moral codes are ultimately founded on emotional instincts and intuitions that were selected for in the past because they aided survival and reproduction (inclusive fitness). For example, the maternal bond is selected for because it improves the survival of offspring; the Westermarck effect, where close proximity during early years reduces mutual sexual attraction, underpins taboos against incest because it decreases the likelihood of genetically risky behaviour such as inbreeding.