Morality is a circle that encompasses all human action. And it is a circle that, barring a few exceptions, grows outwards, encompassing more and more aspects of reality, peoples, cultures, orientations etc.
Regardless of what moral frameworks end up achieving, their goal is usually the same — the betterment of everyone. How different societies define “everyone” differs of course, and therein lies the reason behind why moral frameworks often alienate some people based on either their gender or their sexual orientation or their caste or their nationality or the colour of their skin.
Once upon a time, people of a certain community believed that it was correct to relegate women to a secondary status in society by letting them have no say in how their society functions. Once, it was believed that people of a certain skin tone were somehow inferior to others and that it was alright to treat them like cattle. These actions were seen as correct. And if not, they were at least not seen as wrong.
What changed? Our understanding of the world improved. We learnt that men and women were equal in many ways. We became aware of the fact that all human beings are fundamentally the same. The circle of moral action expanded and took these categories into itself. Now, gender bias and racism are considered immoral.
Similar assimilations happened to various other categories — nationalities, linguistic communities, ethinicities, and so on. The circle keeps expanding.
The expansion of the moral circle is a result of understanding. It is a process whereby we relate more and more with the world that we live in. It happens when we look at other people and see our own reflection in them.