That's a good way to put it - the government regulating contracts; this is where I have an issue, not only in terms of separation of church and state, but as a libertarian in general. It's one thing to have ground rules for contractual agreements - essential, fundamental reasons for the government to "regulate" contracts, such as basic structural requirements to be recognized as formal and legally binding (for example & hypothetically speaking - requiring that a written contract has to be black lettering on white paper, it has to be in a certain font and size, all "i"s have to be dotted and all "t"s have to be crossed, etc.), but having to get permission from the government to enter into a marriage or civil union with someone else, being prohibited by the government to marry outside your race, and prohibiting polygamy, are examples of what crosses the line and infringes on constitutional rights. Whether it's ground rules for contracts or unconstitutional laws, regulations are something that come from the legislative branch of government. Another way to put it is that laws pertaining to contractual agreements aren't at risk of being unconstitutional, provided they don't add to, or subtract anything from, a contractual agreement.
By having and enforcing (set aside "regulating") a contract, whether it's a retail store or restaurant owner suing a co-owner or a divorce, only the judicial branch of government is intervening, and only by going through the contract and facts of the case. It's not only ok for the court to be using laws pertaining to ground rules for contractual agreements, but it ought to be using them - especially if one of the litigants presses for them to be used. However, if there are laws that mandate the adding or taking away of any clauses that the contracting parties had agreed to, and those laws or clauses conflict with, or are inconsistent with, constitutional rights or the free exercise of constitutional rights, then they're unconstitutional.
You might say that laws pertaining specifically to marriage contracts, particularly by standardizing what's automatically included or excluded in the contract by themselves wouldn't be unconstitutional as long as they're an optional template that couples can choose to use or not use, and I would agree, but that's not the point of contention. The point of contention is compelling couples to abide with its "template" marriage contract that includes and excludes clauses prescribed by law; when those included and excluded clauses are modeled from religious rules on marriage, the government is playing favorites, accommodating religion, tailoring for religion, or giving religion an unfair advantage & I consider that to be a case of respecting an establishment of religion, which is unconstitutional.
It doesn't really matter if such laws that require including or excluding clauses literally come from religion or has nothing to do with coming from religion; either way it can exclude some from having the contractual clauses that they want. If a couple's religious rules call for clauses that such laws exclude, or vice versa, then it's a case of constitutional infringement on free exercise of religion. Whatever the case is, the point is that there is relevance between the issue and the thread topic.
In general, litigants don't have to go to a state/government court to settle contractual dispute; they can go to arbitrators, which are separate, independent, private entities not run by or (financially & logistically) supported by the state. In the case of "religious marriages", those arbitrators could be clerics, church elders, church tribunals, etc.
I hope I clarified what you're asking about with my assessment or opinion, here; the way you had it worded & presented was unclear to me.