You would have to consider each of the bases of morality as a separate trait. But the central trait for much of our current moral structure is in a good-tempered altruism or empathy, so I will focus there.
Animals evolve traits that increase the commonness of their genes. To do so they develop traits that make them good mates, so that they have the opportunity to procreate. In doing so, they develop 'virtue signals' for those traits.
Look at plumage on birds, like the tail on a peacock. This is an expensive signal for having a healthy immune system that allows for cells to develop uniformly. It vouches for uniform cell growth because if the bird had some weaker cells and other stronger cells, the patterns of its coloration would probably be larger where it was healthier and smaller where it was weaker, and would not end up consistently in the same shape across individuals.
The cost of demonstrating this balance and symmetry has to be offset by a related hidden survival advantage, or, as a burden, it would breed out. In this case, the individual's improved health from the better immune function has to be large enough to offset the obvious inefficiency of walking around with a large broom attached to oneself.
The more visible, costly trait then indicates the presence of the more important trait that is otherwise harder to identify, and mates select for it.
Signals that are not also expensive do not tend to take over populations, they tend to create differences between individuals through direct competition. But if the trait is expensive, then to survive in spite of this waste requires the additional hidden advantage to be significantly better among those with the signal.
So display of such patterns becomes a part of mating rituals, and eventually often become mandatory requirements for attracting a mate at all.
Altruism does have direct survival value when it extends to one's immediate family. If one shares ones good fortune with one's mate or one's brother, one has increased the likelihood that genes one has will spread -- you will have children, or your close relative will have children.
But such behavior is expensive because it leads you to forgo advantages to yourself directly.
To survive in spite of altruism requires your group to be significantly more resourceful, or despite your support of one another, the added waste of your not being selfish would spend out your resources and kill some of you off. Smart families have smart children. So this speaks to your general intelligence.
Thus altruism becomes a 'signal' for general intelligence.
But humans also have culture, including leadership. Since those with the highest general intelligence often become leaders, they then push their own values onto those they organize and protect, and this value becomes something culturally mandated and taught to those to whom it does not come naturally. The form that this instruction takes is what we see as moral development.
Similar arguments can be made for the other aspects of common ethical principles like honor, consistency, temperance, accountability, etc. to the extent those do not already flow out of the combination of altruism and logic.