This problem is compounded by the fact that JWs promote such black and white thinking. This is especially well ingrained if you were raised in the org. Even with the best of intentions after leaving, it is hard to get rid of. It may have some to do with evolutionary make-up, but I believe most of it is a learned behavior, as least when it comes to categorizing and judging people.
On another point with this issue ... when you are a JW witness, you are forced to fly with the flock and no one else. If you live in an isolated area or go to a small congregation, all of those other factors you mentioned that are normally cohesive or divisive in the world do not matter. If you are a preteen in a congregation with only one other preteen, you better like them because they are all you've got as a friend. You could have absolutely nothing in common with this person, but you are forced to be their friend because you are forbidden to associate with any of the other "flocks" of the world.