I’m an atheist myself, to be clear.
But I’m surprised how many atheists are saying morality is strictly the application of an evolutionary function and not something greater and more important than the sum of our biological parts. If morality is just a story we tell ourselves to justify our animal communal nature, then it has no strict importance and you should be able to excuse murder, rape and slavery if a person claims to be acting on a greater biological imperative.
If our belief murder is wrong only comes from a biological imperative to be part of a community, then why is it not okay when somebody’s biological impulse to spread seed leads to a rape? If morality is only a biological function, why judge anyone for not having it, as long as you yourself are not threatened by their moral violations?
Well, for starters, empathy has already been mentioned. It is also a human instinct that evolved because of our social nature, social groups have a higher chance of survival if the members feel compelled to help each other out. And second, again, the good of the social group (let's just call it a tribe), just like with killing. Empathy left aside, rape can do long-term damage to the victim, both physically and emotionally, which in turn hurts the tribe in the long run. And especially in repeat offenses, other males would see the rapist as impeding their own impulse to procreate.
Now, I know this all sounds rather cold, cynical and analytical, which is why I wish to again remind about empathy, because that's the obvious main response. All the other things I mentioned would be secondary, or even subconsciously.
We all, I assume, apply a set of basic moral standards to everyone with no exceptions other than to prevent more serious moral violations. It’s more to us than an animal desire to be part of a community and instinct to feel empathy. It’s an abstract principle greater than the sum of our biology.
Otherwise, why call anything immoral that does not relate to our own stake in other people’s behavior? Why care what happens outside our clan at all, why be bothered when Trump dehumanizes immigrants? We evolved to be part of a clan and act morally within the clan, we did not evolve to treat all humans as members of the clan. We came up with that ourselves.
As I wrote in my first response to your line of questions, who and what we consider part of our social group has evolved through the ages, from tribes, to nations, to ethnicities, to religious groups, to class, and finally the more global view that many of us have today. I also talked about the reasons of why some people dehumanize groups of people they wish to harm. And if you look around, there are certainly still people with different views on who they consider part of their community deserving of their personal protection. Racists are still out there, powerful people with disregard for the less powerful, religious people with fear and hatred of other religious, or non-religious, groups, dehumanizing based on gender and sexuality, etc. So, yeah, that obviously still exists, but over time we have made progress towards the kind of global tribalism you are speaking of.
There are, of course, factors to bring us to this. Media is a major factor. From translated books, films and television, international news reports, to finally the globally connected world wide web. This all allowed us to connect with one another, relate to one another, and actually (rather than just rhetorically) view ourselves as equal parts of a bigger humankind.
If you wish to know more, it's called sociology. I recommend looking into it.