Washington, Coolidge, and Reagan were the three best. But I’ll have to think about Polk based on what you’ve written.
I just thought of something. You know what two presidents had some similarities? Lincoln and George W. Bush. Both were deeply religious men who got us into wars for primarily moral reasons but both wars were legally dubious. Both won their wars and had successors who screwed up the peace. (Note that I didn’t put either Lincoln or Bush in my top three but both would probably end up in the middle of my rankings.)
People today are inclined to think that Lincoln was religious because of the language that he used. There is no doubt that he was very familiar with the Bible and often borrowed from it. But his familiarity is like that of the skeptics who run the infidels.org website.
It is doubtful that Lincoln was a Christian in any sense much less “deeply religious”. His very close friends Lamon and Herndon were self-described infidels and skeptics and they insisted that he was one of them. Lincoln never joined a church and never made a profession of faith. As a young man he was famous for ridiculing preachers. If anything he was a rationalist on the model of Thomas Paine. He was rumored to have once written a pamphlet along the lines of Paine’s Age Of Reason.