Imho marriage based on religion or law made by The State is an artifical concept to put some order into the second-smallest part of human society. The smallest part is the individual; the second-smallest is the marriage which ends in a couple unless you are Mormon or Muslim or member of some other special religion (no offense intended; just statement of facts); then the third-smallest is
the family.
In either case, so in case of a marriage based on religion or based on law, certain rules are applied - rules which bind the individual as well as the couple, but also rules which bind the society, the religious community, or The State. Such rules combine allowances and permissions on the one side, limitations and duties on another side, and probably certain priviliges on the other side. This overlaps with the idea of the contract mentioned by reaper239.
Since marriage is the foundation of a certain "social unit" (a couple mostly), and this unit interacts as such within the society and in front of The State, I think it is pretty important for the society and The State to know what they are up against. Thus rules need to be established which allow The Community (as the combination of The State and society) to interact properly with the married couple. Therefore I have no trouble with The State getting involved with or even superseding the religious ceremony of marriage.
After all the Religion itself only applies for a part of the society, while the Marriage itself is in force against everyone and everything. Therefore the Marriage as such has a much more impact on the social and public community then on a certain religious part within the community.
Also I don't see the point why only Religion may be the source of organizing the fundamental elements of the society. It is what society does with itself; and for this it uses the empowerment of public authority through The State, which receives its legitimation from the people, the society.
I think all of this does not interfere with the religious ceremony as such. It is just the means to recognize certain religious beliefs and to establish the marriage in the face of the personal religion. This is how things work here in Germany: You get married at the public authorities, and you may also perform the religious rites accordingly. The difference, though, is that the general acceptance of the marriage stems from the marriage in from of the Civil Registry Office.
All the best!
Liam