This is also known as the "But Clinton..." fallacy.
The idea is, if you can show someone else perpetrated the same transgression, this is supposed to excuse it.
This fallacy works even more in association with a strawman to associate two dramatically different levels of the same transgressions (lying for example) as being equal in repercussions when they are not.
Hey, Bush lied to the American people about getting us into war with Iraq, But Bill Clinton also lied and he got impeached!
If A does X, then it's not X, if B does X to A.
If a thief steals , it's not stealing if you take it from the thief because it was already stolen.