EvolutionI do not know how morality arose in mankind, but I offer this as a possibility. Firstly, evolution gave us the basics. Our morality is based on empathy and a sense of fairness. We want the best for ourselves, but we can appreciate that others want - and deserve - the same. That empathy and sense of fairness is something we have got from evolution.
Man is a social animal; he survives best by co-operating in a group or tribe. And co-operation is going to work best if members of the group get on with each. If in one tribe the members empathise with each other, and so share food fairly, they will co-operate better than in a tribe who do not share food fairly, but are constantly fighting each other for the better share.
Thus, if empathy and a sense of fairness are inherited, they will be selected for.
Is there a reason to think this is true? Absolutely! Chimpazees, our closest relatives, have empathy and a sense of fairness, as these links show.
This indicates that empathy and a sense of fairness are indeed inherited traits. However, we would also expect our nearest relative on the evolutionary tree to be similar in this regard, so this is also a confirmed prediction. Two good reasons to think this evolutionary scenario is true.
CultureWe have a much more advanced morality than chimpazees. Can we really credit evolution with that? Perhaps not, but we do not need to. What sets mankind apart from chimpazees is the ability to preserve ideas from one generation to the next. We live in a world of computers and aerolanes and skyscrapers! But we do so because of the achievements of the last generation, who in turn relied on the generation before that.
Our morality is the same. It has developed over millenia, just as our building skills have. Primitive man lived in crude huts and had a crude morality that encompassed his own tribe only (and we can see that in the Old Testament, when the Israelites would cheerfully slaughter an entire tribe to capture their lands).
The advanced morality we have today is not a product of evolution, not directly anyway, but a product of our intellect. If there is an objectve morality, it is an abstract concept, like mathematics. If morality is grounded, it is grounded in mankind and nothing more than that. We "ought" to behave morally because people have value, and they have value because we say they do. People have rights because mankind says they have rights.