In psychology it is called cognitive dissonance when you experience two or more conflicting beliefs. Some people would change their system of beliefs, others would just go on deluding themselves. This can be applied to religion, nationalism, political believes, "conspiracy theories", historical events and figures, facts about close friends, relatives etc.
I'm looking for philosophers and works that talk about the need people may experience to deceive themselves?
“You have to understand, most of these people are not ready to be unplugged. And many of them are so inert, so hopelessly dependent on the system that they will fight to protect it” The Matrix (1999)
“Sometimes people don't want to hear the truth because they don't want their illusions destroyed.” Nietzche
"A man is his own easiest dupe, for what he wishes to be true he generally believes to be true." Demosthenes 384-322 BC