In Descent of Man, Darwin argued that human morality had evolved from the social instincts of animals, especially the bonds of sympathy and love. Darwin had first speculated about the evolution of the moral sense in his private notebooks:
Looking at Man, as a Naturalist would at any other Mammiferous animal, it may be concluded that he has parental, conjugal and social instincts, and perhaps others.... These instincts consist of a feeling of love & sympathy or benevolence to the object in question. Without regarding their origin, we see in other animals they consist in such active sympathy that the individual forgets itself, & aids & defends & acts for others at its own expense.—
(Barrett et al. eds. 1987, p. 619)
Darwin gathered observations over many decades on animal behavior: the heroic sacrifices of social insects, the tender bonds of affection between female apes and their offspring, the courage and loyalty of dogs for their masters. Cooperation and regard for others were beneficial to animal communities as a whole, and helped them to survive in the battle for life. Though rooted in instinctive sympathy, moral behavior for Darwin was not purely automatic or unconscious. In Descent, he argued that many animals possessed memory, imagination, and reasoning ability sufficient to compare present and past actions. They could recall the pleasure they experienced when acting in accordance with social instincts, and the pain they felt when more immediate, selfish motives prevailed. Humans, with their more advanced abilities of language and abstract thought, were able to formulate moral principles and complex codes of conduct, but the foundations of ethical behavior remained the social instincts that humans shared with animals.
Darwin's moral theory was the most controversial aspect of his work on human evolution. By the 1870s, many of Darwin's contemporaries accepted that humans had descended from animals in physical form, but they insisted that animals lacked anything comparable to human moral principles and feelings, such as obligation, compassion, guilt, and the pangs of conscience. Darwin's theory was condemned by The Times for undermining the foundations of social order. It was rebuked by the religious writer, Frances Power Cobbe, for rendering moral the brutal behavior of bees who killed female members of their hive in order to protect the queen. Darwin engaged with his critics in correspondence, discussing the merits of Kantian philosophy, the utilitarian ethics of Mill, the conscience of dogs, and the motives that led one man to risk his life to save another.
Letter 7048: Darwin, W. E., to Darwin, C. R., [April? 1871]
In Descent of man (1: 71) Darwin briefly contrasted his moral theory with that of John Stuart Mill, who seemed to regard ethics as arising from the human intellect through the association of ideas, rather than as evolving from animal instinct. Darwin got clarification on this point from his son, William.
"Mill says about ^1/3^ way thro' the last chapter of Utilitarianism that the feeling of justice grows out of the impulse of self defense, and the feeling of sympathy [but]... it seems to me that he considers the social feeling in man the result of association and depending upon intellect to a great extent. It is very extraordinary that he should recognize the social instincts to be natural to Animals, which he can hardly put down to intellect, and should consider them almost entirely the result of intellect & association in man.... he must have been very close to allowing the moral faculty to be inheritable, but rather in a muddle on the whole subject"
Letter 7645: Morley, John to Darwin, 30 March 1871
The politician and man of letters, John Morley, wrote an anonymous review of Descent of Man in the Pall Mall Gazette (Morley 1871). Darwin admired the review, and initiated a correspondence about the power of natural selection to shape moral ideals, the role of instinct and intellect in moral behavior, and further discussion of the relationship between his theory and Mill's utilitarian ethics.
"I cannot help thinking ... that you are inclined to prolong the operation of Natural Selection into times and conditions wh. belong of right to what I should call Social Selection--i.e., the selection by a community, through its current opinion, laws, institution, traditional usages, and so forth, of certain qualities and ideals of character, for admiration.... the transmission is not physical, from father to son, but 'in the air' from generation to generation."
Letter 7685: Darwin to Morley, John, 14 April 
"When I speak of intellectual activity as the secondary basis of conscience, I meant ... secondary in period of development.... Do you not think that man might have retrograded in his parental, marriage, and other instincts, without having retrograded in his social instincts ... I do not think that there is any evidence that man ever existed as a non-social animal."
Letter 7691, Morley, John, to Darwin, 17 April 1871
"I don't think Mr. Mill's expressions ... point to any fundamental difference between him and yourself. He admits the moral faculty is capable of springing up 'spontaneously' in 'a certain small degree'... and this is as much as you want, is it not?
"I don't know whether you are indignant or amused at writers who call you reckless for broaching new doctrines as to the moral sense, at a time when Paris is aflame".
Letter 7145: Darwin to Cobbe, F. P. 23 March [1870?]
Darwin met the religious writer and social reformer Frances Power Cobbe in Wales in 1869, and she recommended that he read Immanuel Kant's Metaphysics of ethics. Darwin thanked her for the book, which he cited in Descent 1: 70--1, and contrasted his approach to that of the German philosopher.
"It has interested me much to see how differently two men may look at the same points ... the one man a great philosopher looking exclusively into his own mind, the other a degraded wretch looking from the outside thro' apes & savages at the moral sense of mankind."
Letter 7149: Cobbe, F. P. to Darwin, 28 March [1870?]
"I more than suspect you of a smile in your beard when you write of him as 'great philosopher...' But surely may I not argue that, afer all, his mind, & that of another philosopher I could name are things not wholly underserving of attention,---phenomena quite as much needing to be studied & accounted for, say, as even our beloved dogs?... are you ever going to unite your lines of thought & let us see how metaphysics & physics form one great philosophy?"
Letter 7470: Wedgwood, Hensleigh to Darwin, [before 3 March 1871]
Darwin exchanged long letters with his cousin, Hensleigh Wedgwood, who argued that moral behavior was rooted in feelings of shame, and the praise or blame from one's fellows.
"Shame is the true essence of conscience, not resolutions as to one's future conduct. The source of the dogs shame is ... a consciousness of his masters disapprobation... The sense of disapprobation of a mind to which look with reverence or respect is shame."
Letter 7537: Darwin, C. R. to Wenslow, Hensleigh, 3 March 
Using the example of the English pointer, Darwin insisted that conscience arose through a conflict between enduring social feelings and more fleeting desires, such as hunger or the urge to give chase.
"A good pointer, if ... overmastered by the temptation of the sight of the living hare, he rushed in ... he wd then feel indignant or dissatisfied with himself & regret his conduct."
Letter 9377: Darwin, C. R. to Abbott, F. E. A., 30 March 1874
Writing to the American philosopher and free-thinker, Francis Ellingwood Abbott, Darwin suggests that even moral creatures may be governed primarily by instincts rather than by abstract ethical principles.
"The lower social animals may be said to be under an obligation not habitually to kill each other, & the mothers to protect their offspring. I think this mutual bond may be called an obligation, as the species c^d^ not exist in society without it. No one w^d^ call it a moral
obligation, & most persons w^d^ call it instinctive ... Now as soon as a social animal became in some slight, incipient degree a moral creature,----that is----was capable of approving or disapproving of its own conduct ...would not the obligation remain, to a large extent, of the same so-called instinctive nature as before?"
Letter 12610: Preston, S. T. to Darwin, 20 May 1880
In correspondence with the engineer and physcist, Samuel Tolver Preston, Darwin debated the role of self-interest and instinctive sympathy as moral motives in prompting one to risk his live to save a drowning man.
"It has appeared to me that the supposed undesirability of making Self or Self Interest the standard of morality is in reality questionable.... Now (as I venture to submit) the only rational----and even only possible----motive for an action (which is not instinctive or random) is Self or Self-Interest."
Letter 12615: Darwin, C. R. to Preston, S. T., 22 May 1880
"My conviction as yet remains unchanged, that a man who (for instance) jumps into a river to save a life without a second's reflexion (either from an innate tendency or from one gained by habit) is deservedly more honoured than a man who acts deliberately and is conscious for however short a time that the risk and sacrifice give him some inward satisfaction."
Darwin, Notebooks, OUN (30 [pp. 390--91], 42-9 [pp. 398--401]), N (2-4) [pp. 330--1]. Barrett, P. H. 1974. 'Early writings of Charles Darwin', in Gruber, H. E., Darwin on man. A psychological study of scientific creativity; together with Darwin's early and unpublished notebooks. (London: Wildwood House). [available at Darwinonline]
Darwin, Descent of Man, chapter 3. [available at Darwinonline]
Cobbe, F. P. 1871. 'Darwinism in morals'. Theological Review 8:167-92. [available at archive.org]
Morely, John. 1871. 'Mr. Darwin on conscience', Pall Mall Gazette of 12 April 1871. [link to pdf]
Huxley, T. H., 'Evolution and ethics' (1893), and 'Evolution and ethics: prolegomena' (1894). [http://archive.org/details/a588314000huxluoft]
Moore, G. E. Principia Ethica (1903), ch. 2. [http://archive.org/details/principiaethican00mooruoft]
Dixon, T. 2008. The invention of altruism: making moral meaning in Victorian Britain. Oxford: Oxford University Press.
Lewins, T. 2007. Darwin (London: Routledge), ch. 6
Richards, R. J. 1987. Darwin the development of evolutionary views of mind and behavior. (Chicago: University of Chicago Press), ch. 5.
Kitcher, P. 1994. 'Four ways of "biologizing ethics", in E. Sober ed., Conceptual issues in evolutionary biology. Cambridge, MA: MIT Press.
Richards, R. J. 1987. Appendix 2.
Sober, E. 1994. 'Did evolution make us psychological egoists?' in E. Sober ed., From a biological point of view (Cambidge: Cambridge University Press).
Sober, E. and Wilson, D. S. 1998. Unto others: the evolution and psychology of unselfish behavior. Cambridge, MA: Harvard University Press.
Wilson, E. O. 1978. On Human Nature, pp. 149-67.