irrelevant. not all contracts are sanctioned or defined by the state. the problem is that christians see the state as sanctioning their religious institution, and now, perverting it. the solution is to have the state get out of the business of sanctioning it.
Legality is tied to morality and morality is tied to religion (in those who believe in religion). You cannot separate them out in a society with high regard for religion. Even if you remove religion you still have the cultural views on morality which become tied to the state's laws.
The weird thing for me is why people feel this need for the state to legitimate the institution. If your church, and your family, recognize your union as a marriage, that's great. You've made a public pledge to the people that matter in your life.
And if your church and your family doesn't recognize my union as legitimate marriage, perhaps because my previous divorce wasn't legitimated by an authority you recognize, or because its a gay marriage, or an inter-racial one, why should I care? My marriage isn't for you, just as yours isn't for me.
But when its the state, well... then get pretty tricky very fast.
Christians say marriage is a religious institution, holy from time immemorial. My own view is that marriage has been many things in different times and places, but were I to grant Christians the point, the implication should clearly be: the separation between church and state clearly demands that the state stop sticking it nose into religion.