Thing is, even the idea that marriage is a 'religious' act is fraught with confusion in the first place. It is, for the main part, a social act, it roughly translates to 'this man/woman belong me!', and has grown outward into a ceremony from there, like so many other rites that probably date back as far as civilization.
Yes, religion is almost inevitably involved, but more as a vessel to come up with a show, whether it is the blessings of Hapi as you sail down a Golden Barge in the Nile, waiting to become the partner of an Egyptian Pharaoh (and because all etchings depicted all Pharaohs as male, there's very little guide about the marriage principles of ancient Egypt) or a Mayan farmworker at the local shrine being cut in sensitive places by a lower priest as a symbol of wedlock to the woodcutters' daughter, religion just does the pomp and circumstance (or -cize in the case of the Mayans).
To say that marriage is the property of a specific set of religious values suggests there is only one kind of 'real' marriage, which is, oddly enough, also a violation of Freedom of Speech.
In this case, the Goverment takes the place of a religion in 'sanctifying' the wedding with it's own holy sacrament... paperwork. All the law really does is instate that in law so that the institution of 'being married' has to be respected, just as if it were performed in a Church, a Mosque or a Gurdwara.