Opposition to interracial marriage developed as one aspect of a larger system of racism and white supremacy, as part of an effort to hold a race of people in a condition of economic and political inferiority and servitude. It was based on the idea that contact with African Americans on an equal plane is wrong.
That idea, and its premise of the supposed inferiority of African Americans, is the essence of bigotry. Bakers who declined to bake cakes for interracial weddings also declined to treat African Americans equally in a host of circumstances. Racists did not simply object to interracial marriage; they objected to contact with African Americans on an equal footing.
By contrast, marriage as the union of husband and wife has been a universal human practice until just recently, regardless of views about sexual orientation. This vision of marriage is based on the capacity that a man and a woman possess to unite as one-flesh, create new life, and unite that new life with both a mother and a father. Whether ultimately sound or not, this view of marriage is reasonable, based on decent and honorable premises, and disparaging of no one.