The Basis for all Morality

Righteousness is entirely defined by what-so-ever simultaneously maximizes the joy of each individual.

2 Nephi 2:25 … men are, that they might have joy.
Since the ultimate purpose of human existence is joy, then whatever maximizes joy best meets this intended purpose.