I honestly don’t know what else to call it.
Sometimes, when a fictional character’s inner monologue gets exposed, you may hear them thinking something stupid or rude. This cues a violent self-correction reaction along the lines of “how can I think that, I shouldn’t think that way, that’s awful of me”. I’m sorry, what? It’s not like you said it out loud, nobody is any the wiser. It was just an intrusive thought, calm the hell down!
It’s fairly normal for strange thoughts to cross your mind, and hey, everyone gets a bit mentally aggressive sometimes. And it’s perfectly fine if you acknowledge those thoughts as existing and “being bad”. Thinking them over first keeps you from acting on them, if that was even something you’d feel like doing to begin with.
The example I described above seems way more common in Japanese media, so maybe it’s an honor thing? Nobody knows, so it’ “private honor” in that sense, but I still can’t imagine some stray thought blowing that big a hole in your perception of your own good nature. In fact, recognizing and vilifying the “bad” thought should count as more than just redemption, it’s a sign you’re trying your hardest to be a “good” person.
But what do I know, social culture can be weird.