If we went by majority and popular opinion all the time there would still be slavery, segregation would still be a thing, same-sex marriages would be illegal, there would be no abortion rights and so and so forth.
I'm not sure about this. At least for the same-sex marriage, seems that majority in US approves it in recent years. I don't think a regulation can or should make that kind of change while like 80% people don't agree with it.