Defensive attribution hypothesis
We tend to believe theories about the cause of a mishap in a way that minimizes our own blame or threat in that mishap.
A related effect is that we tend to assign the blamed people to an out-group - we "other" them. This is called defensive othering effect.
Example
If we were in a car accident, we would believe that it was the fault of the other driver.