“It is the duty of every man to render to the Creator such homage, and such only, as he believes to be acceptable to him. This duty is precedent both in order of time and degree of obligation, to the claims of Civil Society. Before any man can be considered as a member of Civil Society, he must be considered as a subject of the Governor of the Universe.”
–James Madison, A Memorial and Remonstrance, 1785
There are very similar quotes from most of the founders. It’s pretty simple. This is not a chicken or egg question; precedence is clear. They knew what came first. They believed that if you lack a fundamental foundation for moral behavior, it is far less likely that you will be a citizen who ever looks much beyond immediate short-term self-interest, to what is good for the society as a whole.
Events have not proved them wrong.