It's interesting....years ago I did a training course based around NLP, and one of the exercises we did was the answer the question "when is it okay for you to lie to someone?". After we'd done that - and come up with a few good reasons - we were than asked the question "when is it okay for someone to lie to you?" And all of a sudden all the good reasons we have come up with for the previous question fell apart.
About the only one we could come up with was that it was okay to be lied to if (1) we would never, ever be able to learn the truth, and (2) the lie would give comfort and spare us from a harsh reality. So for example, my wife dies in a car crash, witnessed only by one paramedic. In reality, she died screaming in agaony over half an hour - but he told me she was unconscious all the time and just slipped away.
I see those two points (never know truth, and spare from reality) as being very close to the reasons that theists want to keep believing. It gives them comfort and spares them from the reality of the godless universe, and they will never have to face the truth, 'cos when you're dead you're dead.