It's really about "us" and "them". If you belong to "them" for whatever reason then all manner of indignities may be perpetrated upon your person by "us". The social contract seems to require this behavior in order to reinforce belonging to "us". I'm quite sure that religion is too limiting a context for this discussion of man's inhumanity to man. The literature is replete with examples of this theme.