Same-sex marriage was legal in the Middle Ages. Homosexual relationships were preferred in ancient Greece and considered natural in ancient Rome.
Attitudes toward homosexuality and same-sex marriage have changed over the ages and there seems to be a fluctuation when it comes to society's acceptance of homosexuality.
In ancient times, however, there was nothing strange about it and it was not frowned upon at all.
In ancient Greece same-sex relationships between men were actually often favored over relationships with women.
One ancient saying claimed that "Women are for business, boys are for pleasure." Ancient art and love poetry shows a deep emotional connection in same-sex relationships of that time.
In ancient Rome, homosexual and heterosexual were not even categories of Roman sexuality. No words exist in Latin to describe these concepts. It was socially acceptable and considered natural for men to have same-sex relations.
It is only after the Roman Empire came under Christian rule that legal penalties for homosexuality were instituted.
During the Middle Ages prominent figures such as Edward II, Richard the Lionheart, Philip II Augustus, and William Rufus were engaged in same-sex relationships.
There was a legal category called "enbrotherment." This allowed two men to effectively live together as a married couple. This could very well be the earliest form of same-sex marriage.
It seems that the intolerance toward homosexuality and same-sex marriage is actually a recently developed societal mentality and its origin is most likely embedded in religious belief systems.