It is hardwired into our genes, so you really want all people in your society to be part of the same ingroup.
Things which destroy a common group identity e.g. immigrants who don't assimilate or cultivation of political group identities which trump national identity tear society apart. You end up with your neighbor being part of an outgroup - a recipe for hate and violence.