Sure, law is about morality. That’s unavoidable. The error here is in thinking that the Constitution empowers federal courts legitimately to substitute their judgments in such matter for those of the sovereign states/people. The Tenth Amendment makes explicit the ’til-then-implicit principle that the Constitution gave the Congress power over only the enumerated areas–of which definition of marriage is not one.
Religious arguments regarding marriage are perfectly valid at the state level.