"But there is debate as to whether this self-deception is intentional or not."
"In philosophy, after Jean-Paul Sartre's analysis of the concepts of self-deception and bad faith, the latter concept has been examined in specialized fields as it pertains to self-deception as two semi-independently acting minds within one mind, with one deceiving the other."
"In his book Being and Nothingness, the philosopher Jean-Paul Sartre defined bad faith as hiding the truth from oneself. The fundamental question about bad faith self-deception is how it is possible. In order for a liar to successfully lie to the victim of the lie, the liar must know that what is being said is false. In order to be successful at lying, the victim must believe the lie to be true. When a person is in bad faith self-deception, the person is both the liar and the victim of the lie. So at the same time the liar, as liar, believes the lie to be false, and as victim believes it to be true. So there is a contradiction in that a person in bad faith self-deception believes something to be true and false at the same time."
I'm trying to self-introspect on my Mormon days to understand how I deceived myself for so long. I think what happens is that the brain builds a reward center around "strength of belief in X" because religion defines virtue as belief; and we want to be good, so our "goodness reward system" gets connected to our "belief system." So when you obtain information that conflicts with X, your reward center gets very unhappy. When the reward center is unhappy, the other areas of the brain try to make new discoveries that can satisfy the needs of the "belief reward circuit." This becomes mental gymnastics. If one can reinterpret the data in a way that satisfies the belief cortex, we get a surge of positive emotion. We also feel like we have tapped into a deeper layer of understanding God.
For example, when I was 13 I was a young earth creationist. I went online to debate people in a science forum. I got schooled hard. Every argument I had was destroyed. I then formed a new interpretation - when God says "created in a day" he is being metaphorical!! A day could mean a long period of time! This allowed me to satisfy my "belief cortex", absorb the new information, and feel more intimately connected to a deeper understanding of God.
Similarly with evolution, I learned how evolution worked from my debates on that forum. And then I realized that evolution was a beautiful natural system for creation - and that if I was a God, I might be inclined to use the tool of evolution for creation as well! Hence I felt a new intimacy in my understanding of God, and even stronger faith than before!