-2 groups, A and B.
-A and B are reference groups of identity.
(In Buddhism, the flaw - thinking we "exist from our own side" - occurs at this point.)
-B is bigoted against/about A.
(In Christianity, the flaw - failing to "love our neighbor as ourself" - mostly occurs here.)
-X is viewed by B as a negative behavior.
-Y is viewed by B as a positive behavior.
-a member of A does X(bad), B sees this as an example of 'all' A's.
-a member of A does Y(good), B sees this as an exception to 'all' A's.
-a member of A repeatedly does Y(good), B sees this member of A as one who has transcended 'A-ness' and learned to behave like B's, though this designation is conditional on that member of A always doing Y.
-a member of B does Y(good), B sees this as a "perfect example of itself."
-a member of B does X(bad), 'all' other B's see that as an exception to B's.
-a member of B repeatedly does X(bad), 'all' other B's see that member of B as "acting like an A." They are exceptions to all B's; an example of a "bad B."
To B, the only thing worse than an A is a "bad B."
Therefore, through the flawed processes of misidentification, negative reference group behaviors, uncharitable actions and attitudes, and group social pressures - bigotry is sustained.