Well, maybe not quite. Adams made this claim in a letter to Thomas Jefferson, but there's a crucial context that Maher is omitting:
Twenty times, in the course of my late Reading, have I been on the point of breaking out, "This would be the best of all possible Worlds, if there were no Religion in it."!!!! But in this exclamati[on], I should have been as fanatical as Bryant or Cleverly. Without Religion, this World would be Something not fit to be mentioned in public Company—I mean Hell.In this letter to Jefferson, Adams seems less to be making a wholesale rejection of religion than to be claiming that a wholesale rejection of religion is just as fanatical as a belief that the state should allow only one religion (a statement that Joseph Cleverly, Adams's former schoolmaster, once made).
It is somewhat ironic that, in a diatribe attacking the supposed stupidity of others and implicitly suggesting that religion is the province of the ignorant and depraved, Maher mangles a quotation and reduces the complexities of Adams's thought to a crude, and mistaken, caricature. While some of the Founders were not afraid to challenge orthodox Christian beliefs (at least by the standards of many today), to identify them all with the rejection of religion is an unfortunate distortion. Moreover, the virtues of science and intellectual enlightenment, which Maher says he supports, are in no way helped by wild quotations out of context. It is that attention to context and to detail that helps distinguish the scientific worldview.