Mercier and Sperber give an impressive argument here: Why Do Humans Reason? Arguments for an argumentative theory The standard view of reasoning is that its primary function is correct cognitive functions and find the truth. They argue that it is better understood as facilitating persuasion in social or communication contexts. Their thesis, they maintain, better explains the available evidence that shows how bad humans are at reasoning.
Their section on Motivated Reasoning contains this nice summary of some of the literature. The applications to the sorts of reasoning we frequently see coming from religious believers seeking to defend the God/Jesus conclusion at all costs are striking. For now, all I have time to do is offer a long quote: