Charles Darwin himself addressed this morality issue in his
"Any animal whatever, endowed with well-marked social instincts, would inevitably acquire a moral sense or conscience, as soon as its intellectual powers had become as well developed . . . as in man."
In describing the evolution of humans in Descent of Man, Darwin (1871) prominently addressed mental and moral abilities. Following cultural discourse at the time, he focused on what he called the moral sense, or conscience, notably reflected in the emotion of remorse. "Why do we feel moral duty?" Darwin wondered.
First, Darwin observed that animals could evolve societies, structured (he assumed) by a social instinct.
Second, with multiple instincts, behavior might not always accord with social benefit. But memory, Darwin thought, would help resolve such conflicts as the organism learned to regulate its instincts, making the social instinct primary.
Third, the use of language would allow organisms to communicate their needs clearly to one another.
Fourth, repetition would lead to habit, and a spontaneous sense of what one "ought" to do.
While incomplete and flawed in some respects, Darwin's early sketch remarkably identified many relevant variables and processes, discussed in the link below .Darwin followed Descent of Man with a whole volume exploring The Expression of Emotions in Humans and Other Animals (1872).
This website contains amazing pictures of animals exhibiting concepts of morality. Be sure to let your mouse rest on the picture to get a hint of what you are seeing. Clicking on the illustration brings up a more detailed explanation of the behavior being illustrated. These are not just pretty pictures.
There are many many scientific published, peer reviewed papers presenting the case for morality evolving along with intelligent life. The link above has been included here because it references many other learned presentations.
A textual version, without illustrations, and therefore, much less informative, can be viewed as a PDF here: