Earlier quoted context omitted.
The first amendment restricts congress, not voters. Voters are free to vote for whatever politician they like for whatever reason they like, including religious reasons. The constitution does not demand that religious citizens demarcate and compartmentalize their religious and civic beliefs when they go to vote.
In theory it should restrict the representatives who got voted in from using their religious beliefs in legislating
Completely secular and constitutional laws may be enacted by congressmen that have religious reasons to support that law; e.g. religious legislator may vote for a law against murder because murder is against their religion. The first amendment doesn't regulate the thoughts and reasoning of legislators; religious reasoning for secular laws are fine.
And conversely, secular reasoning for religious laws doesn't make the law okay; a cynical atheist might say that religion is necessary for controlling the unwashed masses, but despite that secular reasoning, a law mandating a religion would still plainly violate the first amendment.