Historian Thomas Kidd is note-perfect here on religion and the Founding:
Was America founded as a Christian nation? This is one of the most heated historical debates in America today, with its implications reverberating from prayers at high school graduations to Ten Commandments monuments on courthouse lawns. On one side of the debate, you have traditional Christians who say the Founders were Christians, and that they built the nation on principles of faith. On the other, you have secularists who argue that the Founders were deistic doubters, if not outright atheists, and who see the Founding as an Enlightenment-inspired, nonreligious event. One’s opinions on this subject often reflect what kind of role you think faith ought to play in modern America, too.
Madison and the evangelicals finally won the day* with the adoption of Virginia’s Bill for Establishing Religious Freedom in 1786 (originally penned by Jefferson in 1777), which guaranteed that “no man shall be compelled to frequent or support any religious worship place or ministry whatsoever nor shall otherwise suffer on account of his religious opinions or belief, but that all men shall be free to profess, and by argument to maintain their opinions in matters of religion.”
Madison’s prediction about churches prospering under religious liberty also came true, as Baptists, Methodists, and other evangelical congregations grew explosively in the decades following disestablishment.
The triumph of religious liberty in Virginia was followed by the adoption of the First Amendment’s prohibition in 1791 of a national “establishment of religion.” But did disestablishment on the federal and state levels mean that Americans preferred a secular public sphere? Not at all. Few Americans could envision such a development.
Even Thomas Jefferson, a deist hailed as a hero of today’s secularists, took a generous approach toward the public role of religion after disestablishment. For example, Jefferson routinely attended religious services in government buildings as president.
Jefferson was the author, of course, of the 1802 letter in which he argued that the First Amendment had erected a “wall of separation” between church and state. But the same weekend he sent this letter to the Danbury Baptist Association of Connecticut, a Baptist minister named John Leland preached before a joint session of Congress, with the president in attendance. Their partnership worked, however, because deists such as Jefferson realized that religious liberty did not require rigid secularism. The Baptists, for their part, knew about Jefferson’s personal skepticism, but they supported him because he was the champion of real religious freedom.
Not all America’s Founders were devout Christians, but America was founded with Christian principles in mind. Among the most vital of those ideals – one that could bridge the gap between evangelicals and deists – was an expansive concept of religious liberty.
*For the story of how a handful of "Enlightenment secularists" joined forces with the Baptists in Virginia but now get all the credit, see an account here.