It is possible to be rational about some things and irrational about others, just as it's possible to be right about some things and wrong about others. We all do it; we think of a shirt as lucky, we play the lottery despite the expected outcome, we approach the beatiful woman who we know will knock us back. No human being is rational all of the time.
Religion often invites and allows irrationality by discouraging people from seeking evidence or questioning doctrine. Scientists and other such intellectually driven people might even relish the chance to relax their faculties now and again, and be swept up in the community of a shared belief.
It is also possible to be both rational and religious because being rational doesn't mean being right. Incorrect premises in people's reasoning can lead them, perfectly rationally, to an incorrect conclusion. The premises on which religions base their truth claims are incredibly hard to pin down.
Your examples of rational theists are not good examples. Franklin was a deist for much of his life, and even as an elderly Christian held "some Doubts as to [Jesus's] divinity". Einstein did not believe in a personal god, or anything which could contravene the laws of the universe. He effectively thought God WAS the laws of the universe, and this is to what he referred when he used the name. He was something like a pantheist, and basically said so: "I believe in Spinoza's God, who reveals himself in the harmony of all being." I encourage you to read up on Franklin, Einstein and Spinoza. They're fascinating people.