When cornered, we tend to lash out in defense, whether verbally or physically. When accused of some form of intolerance—such as being sexist or racist—that natural defense mechanism manifests itself in a slightly different way. Rather than attack the accuser, we instead try to convince them of our innocence by citing the fact that we have so many friends of said gender, race or sexual preference.
Society commonly refers to this phenomena as the "I Have Black Friends" excuse, and recent research delves into the psychology behind it. As Eric Horowitz writes on his blog, Peer-reviewed by my neurons, scientists found that "threats to moral identity increase the degree to which people believe past actions have proven their morality."
To demonstrate this tendency, researchers presented a case study about a theft and asked participants to judge whether a white or black person was guilty. Those who correctly identified the white person as the guilty party were then given another task. Horowitz explains:
Participants who made the non-racist choice then had to either anticipate a threatening situation (having to defend a statement that compared Blacks unfavorably to Whites) or a non-threatening situation (defending a statement unrelated to race.) Participants then rated how much their initial selection of the White suspect was diagnostic of their non-racist attitudes.
Those who had to defend black people against whites—in other words, those who felt their morality was being questioned—were significantly more inclined to view their original choice as indicative of their non-racist attitude, Horowitz describes.
However, that logic probably does not stand in the eyes of others. When another set of participants were brought in as outside observers, they said they did not find the argument to be convincing. In fact, the more insistent the defenders were about their non-racist attitudes, the more guilty they looked in the eyes of their peers. So, even your friend group is the most diverse in existence, it's unlikely anyone will be convinced by that defense.