When both A and B do a thing X, there are two potential logically sound conclusions: either that X is bad and both A and B are in the wrong, or that it's not and neither is. It is unsound to say that A doing X is a problem but B doing X is merely a rhetorical accusation that requires no response.
The idea actually is a valid concept in justice, but only within the realms you posted: If person A does something illegal and then tries to justify the behaviour X with "But everyone does this!", then this is not a valid argument, because either X is illegal or not.
Whataboutism as invented by the economist, though, is just rhetoric nonsense. The USSR was perfectly right in highlighting the human rights atrocities of the US in response to accusations of the US against them. That doesn't make the accusations go away, but it correctly exposes the bigotry.
"but the usa does it" is neither a justification, nor a validation, nor an exculpation. it's just finger pointing and throwing poo at each other in the hope that people, instead of condemning both, concedes the point, leveraging outrage fatigue.
there's a reason why it's considered a propaganda tool, after all.