Yeah. Like many powerful tools, in group/out group dynamics cut both ways. Exclusion for protection is valid and necessary, but unfortunately I think human psychology makes it somewhat pleasant to act like a dick if by so-doing you can cement the “we-ness” of a group by imposing “you-ness” on an outsider.
Good reminder for me to think about the *why* of exclusion when I notice these behaviors in myself.