While marriage between a man and woman was "ordained by god", marriage between a man and woman and concubines; a man and woman and woman ad infinitum; a childless widow and her dead husband's brother; a rapist and his victim; a soldier and his female prisoner of war, were also "ordained by god".
As for how gay marriage would violate religious freedom, do weddings between 2 atheists violate that freedom? Or for that matter, do marriages involving 2 believers of (insert religion here) violate the religious freedom of (insert a different religion here)? I have heard of no supporter of gay marriage wanting religious institutions to perform weddings. Religion in marriage is optional.