Before the Civil War the majority of states had already banned the practice. It had to break down in order to be able to jam in an amendment to the constitution against it. States were already in the process of banning it themselves.
That we operate as a society within the confines of the law. And the confines we exist in can be changed if the majority don't agree that something isn't right.
Actually there are specific confines that cannot be changed by majority. Might I refer you to the US Constitution, which itself constrains which laws are flexible and which are not, and which this administration has run afoul of now on hundreds of occasions?