As Haidt writes in The Righteous Mind, the moral foundation of loyalty helps groups cement bonds and form coalitions. It shows who is a team player and who is a traitor, particularly when your team is fighting with other teams.
The Power of Regret by Daniel H. Pink