Your religion or lack of it has nothing to do with being legally married in America.
Here is law from North Carolina “” After the American Revolution, couples could choose a clergyman or a Justice of the Peace to solemnize their marriage. The laws of 1778 provided that, in addition to the Anglican clergy, all regular ministers of the Gospel of every Denomination, as well as Justices of the Peace were empowered to celebrate Matrimony””
“Your religion or lack of it has nothing to do with being legally married in America.”
And conversely, failure to obtain a marriage license from the state has nothing to do with marriage in the religious sense. Your church may or may not require you to get the license. It’s up to them. They can perform a religious marriage ceremony with or without it. At their discretion.
The solemnization of marriage that you’re talking about has to do with the state licensing procedure. A judge can perform it, no religious involvement is necessary.