That's how these things go, sadly.
As an example, Loving v Virginia, the Supreme Court case that struck down all anti-miscegenation laws, was in 1967. In 1968, a Gallup poll indicated that less that 20% of white Americans "approved of marriage between whites and non-whites."
Three decades later, in 2000, Alabama finally voted to repeal its (inactive) law, and a full 40% of voters voted to keep the racist, useless law in their state constitution.