Marriage throughout the ages is very much tied to the fact that it takes a man and a woman to conceive a child, and when a man and a woman have sex, they will likely conceive a child. Therefore, marriage was instituted to provide a stable home for such children. This is why sex outside of marriage was taboo since it could result in the conception of children that would not have a good home. Since "gay sex" cannot result in the conception of children, the marriage bond is not a necessary prerequisite, therefore "gay marriage" makes no sense in the context of the traditional understanding of marriage.
However, many today have redefined marriage as a commitment between two people who love each other. Soon it will also be redefined to include numbers greater than two as well as animals. It is only with such a definition that gay marriage makes sense. There are those of us who think that such a redefinition of marriage weakens the strength of traditional marriage that is needed to build strong homes that are the best places for children to grow up in. Gay marriage is not the only culprit here. A far greater problem for families is rampant divorce.
The debate about interracial marriage had two motivations, one of which was pure racism. However, there was also a concern about the welfare of the children of such unions because they might not be accepted by the race of either parents. (Watch the movie "Guess Who's Coming To Dinner" with Sidney Poitier. [1]) This was a real problem and continues to some extent to this day, but it is getting better as people become less racist.
1: https://www.imdb.com/title/tt0061735/