That's called group selection, which despite 50+ years of effort is an unproven theory that doesn't fit well (though isn't necessarily contradictory) with Darwinian genetic evolution. Every time someone proposes a case example, someone else invariably identifies a simpler, genetic explanation. Humans, of course, are still an enigma.