Yes and no. If you'll pardon the pun, it divorces it from the religious institution of marriage. This, in my view at least, removes any objection on religious grounds.
Except that those who have religious objections don't seem to accept that.
We aren't talking about the right for gays to get married *in a church*, or in a religious ceremony. We are talking about their right to get married *at all*.
At the moment, in many states, a gay couple cannot go to the courthouse and get married - which is exactly the legal contract you speak of. It already exists, but is denied these people.
I submit that the issue is only tangential to religion. Some folks are homophobic. This is not directly related to their religious affiliations, as there are quite devout people of the same denominations who don't have these attitudes. Religion is being used as a rationalization and support to justify the inability to accept gay folks, and the social connections that often go with religion add to the social-pressure to not accept them.