There's a nice analysis of the history of such laws here. Info there includes:
Interracial romance has been a point of contention in America since the first English settlers established colonies in the seventeenth century. In 1664 Maryland banned interracial marriage due to questions over whether the offspring of a black slave and a white person would be considered a free person or property. In following years, Massachusetts, Pennsylvania, North Carolina, and South Carolina instituted antimiscegenation laws which banned interracial marriage.