The historical roots of same-sex marriage are, in a sense, very shallow. No country in the world officially recognized same-sex marriage until the 21st century. There are no known instances of societies in which gay marriages have been traditionally treated in the same way that heterosexual marriages have been.
It would be possible to say that the historical roots of same-sex marriage are older than human history. For as long as we know of, people have gotten married. We can also assume that gay people have existed since time immemorial. Therefore, we can speculate that gay people have long wished to be treated as the equals of straight people.
However, in more obvious ways, gay marriage has only been on the agenda for about 40 years. In the late 1960s, gay rights started to become an issue in the United States. Gay people, following the examples of the African American Civil Rights Movement, the movement for women’s liberation, and others, started to push for more rights. By the early 1970s, gay couples were suing to be able to marry.
Gay marriage was first legalized by the Netherlands in 2001. Massachusetts was the first American state to legalize gay marriages. This happened in 2003. Today, thirteen states and the District of Columbia recognize gay marriages. The federal government was prohibited from recognizing such marriages in any way from 1996 until late June of 2013. There is, however, no recognized right to same-sex marriage that must be honored by all American states today.
Thus, same-sex marriage does not have very deep historical roots.