You ask, “Why are human beings simultaneously capable of reasoning, and yet so bad at it? Why do we have such faulty mechanisms as the “confirmation bias” embedded in our brains, and yet at the same time, find ourselves capable of brilliant rhetoric and complex mathematical calculation?”
Our capacities have been determined by whether are not they have been selected phylogenetically by our ancestors survival to reproduction. But as social beings our capacities are also promoted to a greater or lesser degree by the cultures within which we develop. Cultures are selected by the belief systems and behaviors of their members that promote the continuation of those cultures.
I would submit that reasoning abilities such as “brilliant rhetoric and complex mathematical calculation” have probably contributed to some of our ancestors survival to reproduction and also to the continuation of cultures that our ancestors were a part of.
Now the tricky part, “confirmation bias” has probably also contributed to some of our ancestors survival to reproduction and to the continuation of cultures that our ancestors were a part of.
One other important factor is that we only know that humans have these capacities, because we see them actualized. One’s capacity for reasoning is actualized during one’s lifetime because it is shaped through the environment and the reinforcing experiences that one is exposed to as reasoning behaviors occur and develop. Again, some environmental and cultural settings are more likely than others to promote and reinforce complex calculating and brilliant rhetoric. But also when one does brilliant rhetoric and complex calculations, I suspect that there is some inherent satisfaction in doing so. Is there not also some subjective satisfaction in a biased confirmation, as long as you do not realize it is biased?
It is also beneficial for many cultures to establish, within its members, biased beliefs that are not subject to any objective discrepancies. (Humans have acutely developed the ability to have faith, aka, believing without evidence or in spite of contrary evidence. This has probably had phylogenetic survival value as well.)
A culture or other setting that is strictly based on empirical thinking and the scientific method would tend not to select for one exhibiting or learning to do biased confirmation, but most of humanity does not live in such a culture or setting. (And our ancestors have not lived in such settings or cultures.) So even scientists must struggle against bias, because it is inherently <or often externally, as in grant money depends on it, or previous theories that made my reputation depend on it> reinforcing to believe some things despite contrary objective evidence.
Hence, one can be skilled at certain types of reasoning and completely lack skill at another.