There really is no evidence that marriage is religious in origin. Indeed, there is evidence to the contrary since all cultures have one or more forms of marriage. If this were an institution respective only to religious cults and not to secular culture, then we would not expect to see such a common practice existing in cults that have such diverse and often contradictory qualities and characteristics from each other.
We see rituals and superstitions like communions and sweat lodges that are diverse and different, but the commonality of marriage suggests, with little reason to think otherwise, that this is a human social function and one that appears to exist in form elsewhere in the animal kingdom. In short, marriage is an evolutionary advantage, even same-sex marriage.