People want to be lumped in with the group they belong to when it comes to positive deeds and qualities of their members. But they want others to see them as individuals when it comes to negative deeds and qualities. And, when they think about their opponents, they reverse these processes.
When you form an ideological group, the impact is greater than the sum of its parts. So, it is tempting to form a group, but if a significantly negative event were to be associated with the group, even the innocent members are negatively impacted by it.
In other words, under positive circumstances, you as an individual can gain more from forming a group than acting independently. But under negative circumstances, you as an individual can lose more from forming a group than acting independently. That is, the net gain of forming an ideological group is zero.