The correct answer is rationalization.
Rationalization is a common defense mechanism characterized by logically justifying something that is unacceptable to feel more at peace with it. Examples of rationalization include evading paying taxes because "the government is corrupt", or telling yourself that you got a poor grade in an essay because your teacher was purposely unfair towards you.