The question of how humans came to have a moral sense is one of the more interesting challenges offered by believers against unguided evolution. Even informed christians who accept the reality of evolution feel a need to add an additional step where god imbued man with a conscience.
Non-supernatural explanations of the origin of morality usually focus on simple examples of reciprocal altruism and the ability to empathise with fellow creatures. Secular moral systems most often rest on the single foundation of the effects actions have on the well-being of conscious creatures. Sam Harris made an excellent case for this position in his book "The Moral Landscape".
In his book "The Righteous Mind - Why Good People are Divided by Politics and Religion" Jonathan Haidt objects that Harris is too narrow in treatment of human morality. Haidt lays out six moral intuitions, each of which conferred a significant advantage on our ancestors. These can be illustrated as being like our taste buds. There are a huge range of cuisines around the globe but each of them appeal to the same universal sense of taste. Similarly our various moral codes are built on combinations of the same moral instincts. Further it is Haidt's contention that our culture suffers from a neglect of some of those intuitions.
In advance I would like to strongly recommend both Harris' and Haidt's books for a very thought provoking treatment of this topic. If you can also find time to add Steven Pinker's recent book "The Blank Slate - The Modern Denial of Human Nature" you not regret the effort.
I will add more detail later but here is a very brief synopsis of Haidt's six moral intuitions.
1 - Care/Harm
Adaptive Challenge - Protect and care for children
2 - Fairness/Cheating
Adaptive Challenge - How to benefit from two-way relationships
3 - Loyalty/Betrayal
Adaptive Challenge - How to form cohesive coalitions
4 - Authority/Subversion
Adaptive Challenge - Forge beneficial relationships within hierarchies
5 - Sanctity/Degradation
Adaptive Challenge - Avoid contaminants
6 - Liberty/Oppression
Adaptive Challenge - The need to limit the abuse of power in hierarchical societies.
I will describe some of these in more detail later. I wonder if we have missed a step. I wonder if anybody is doubting whether caring, kindness, loyalty, guilt, fairness, deference and a desire for cleanness really reside in the brain.
Perhaps that should be the next topic. The experimental evidence is HUGE!