Have you ever contemplated that the "racist, xenophobic and homophobic" behaviour is what is keeping those communities and used to keep other communities homogenous and thereby ensured high-trust?
In that case the xenophobia acts like the immune system but for a community/society.
>Have you ever contemplated that the "racist, xenophobic and homophobic" behaviour is what is keeping those communities and used to keep other communities homogenous and thereby ensured high-trust?
Not much, no. A small community that only trusts itself and pushes any out-group away (regardless of disposition) tends to be called a "cult".