The gay marriage debate gained renewed intensity last week when a federal judge struck down California’s Proposition 8 ban on gay marriage. Supporters of gay marriage hailed the decision as a crucial blow for civil rights; opponents assailed it as an assault on fundamental moral and religious values.

Oddly, both sides agreed on one thing: that government should define and “supply” marriage.

But it is the government’s role in marriage that’s at the heart of the problem.

Marriage means two things in modern society.

Religious marriage is a custom, ceremony or rite that some couples wish to pursue. Religious marriage is not the subject of the legal controversy; no one is proposing that governments bar religions from supplying religious marriage to same-sex couples.

Civil marriage is a legal institution created by governments. It is, in essence, just a bundle of contracts involving the marrying couple, their children and others. A marrying couple gets legal rights and responsibilities about division of property, inheritance, guardianship of children and other issues. The government enforces this bundle of rights and responsibilities.

The question is, does the government need to specify a particular bundle of contracts, enforce this bundle and call it “marriage”?

The answer is no.

If government exits the marriage business, both same-sex and opposite-sex couples would be free to enter private contracts, picking and choosing which ones to sign. Do they plan to have kids? Sign the guardianship contract. Do they need to protect inheritances? Add in that contract. Do they want the whole bundle? No problem.

The result would be that opposite-sex couples and same-sex couples would have the same opportunity to live together, write wills, have biological or adopted children, and so on. Nothing in the law would make any distinction based on the gender or sexual preferences.

The government could still accomplish its legitimate aims in this area by defining default rules for each component. It could, for example, specify that the biological mother is a child’s only legal parent unless the mother voluntarily gives up that status. This rule might also impose that the biological father is responsible for some percentage of child support. (Governments already have such rules because many children are born outside of wedlock.)

Of course, couples who wished to be married could still head off to the church or synagogue. This wouldn’t have any legal implications, it would simply be a private arrangement between the couples and the religious institution performing the ceremony.

Neither supporters nor opponents of gay marriage are likely to endorse the privatization of marriage. That’s because both sides want government policy to validate their own views of what constitutes a “legitimate” family.

But the best path for achieving equal treatment of same-sex and opposite-sex marriage — the goal of those who support gay marriage — is to remove government provision of opposite-sex marriage, rather than extending it to same-sex marriage.

In this arena, as in many others, the way to fix bad policies is by getting rid of them, not by expanding them.