Half Sigma points me to The Legend of a Heretic, which chronicles the close relationship between Robert G. Ingersoll, a prominent American agnostic of the 19th century, and the Republican Party elite of that time. It seems ironic that though we are a nation which explicitly bans formal religious tests, we live at a time where an implicit religious test exists. This despite the fact that Andrew Jackson was probably the first of our presidents who would be considered an orthodox Christian. But even as late as 1908 a Unitarian, William Howard Taft, was president (despite some grumblings about his unorthodox Christianity).
What happened? The past generation has witnessed a massive growth in the number of those who disavow affiliation with an institutional religion, and yet our elected leaders are even more aggressive in testifying to their religiosity. I think this a manifestation of the polarization of religious opinion; while the non-religious increase their share and evangelicals maintain their proportion, the moderates have declined. Since the non-religious are the smallest segment and we live in a democracy so politicians react appropriately. I also don’t think it’s any surprise that when suffrage among males was generally constrained by property qualifications in most states cultural populists such as Andrew Jackson were not elected to the highest office (even political populists such as Thomas Jefferson were cultural elitists).1
The underlying dynamic can be seen more clearly in European politics; limited suffrage which extends to the upper bourgeois benefits parties of the “Left” which we might term liberal. Once the suffrage expands to the whole populace the liberal parties become marginalized and the Left becomes synonymous with more a socialistic orientation; see the replacement of the Liberals and National Liberals in the United Kingdom and Germany by socialist parties as the opposition to the Right. Liberals become bit players & Third Forces defined by their hostility toward both the corporatism of the Right (symbolized by religion) and that of the Left (symbolized by labor organizations). In Latin America there has often been a tension among anti-Rightists between those who are positively anti-clerical and those who might accept a modus vivendi, with the difference often manifesting along class lines. During the Mexican revolution some of the followers of Emiliano Zapata were offended at the extreme anti-clericalism of the other factions, which reflected anti-religious sensibilities in vogue among the elite.