The problem is that there's people who think that as long as government approves of it then God approves of it. Going back to the Bible, one can see how the problem of legalizing sin occurs and how it affects mankind. During the books of 1 Kings to 2 Kings, it can be seen how sins have been made legal. The worst example of making sin legal as mentioned is Ahab and his wife Jezebel. The wicked Ahab supported his wife's worship of Baal and even before that, he was already a very wicked king. Sure, Ahab made the evils of Baal worship legal but it didn't change the fact that idolatry and all the lewdness involved in Baal Worship are immoral.
Daniel's three friends Shadrach, Meshach and Abednego understood it well. When King Nebuchadnezzar of Babylon demanded that they bow down before the golden image of the god of Babylon, they refused. They knew that while they were obliged to obey authority but if their authorities tell them to go against God's Word, they had to politely refuse which they did and chose to be thrown into the furnace. Even if God wouldn't save them from the fire, they would still not bow down to it anyway. The mandatory act of the worship of the god of Babylon was certainly legal but it was also immoral.
Mordecai understood for a fact that bowing down in high reverence to Haman was wrong. He knew that such honors belonged to God alone. He said he wouldn't bow down because he was a saved man. He wouldn't dare give such honors to an arrogant and evil man. Haman took advantage of every legality and tried to make another evil legal - massacring the whole race of Jews all because one Jew wouldn't bow down to him. So Haman the bully decided to try and pass such a horrible law which fortunately met its end because God mightily used Esther and Mordecai to spell the end for such a horrible act.
Today's world isn't any better. We still have a lot of sins legalized in certain areas of the world. In the United States, same sex marriage has been approved by the Supreme Court of the United States and before that sins like pornography, abortion, female sexism and divorce are but a few of many sins that were legalized. In the Middle East where Islamic theocracy is the law, the sins of chauvinism which allows Muslim men not to only take up to four wives but to also beat up their wives is perfectly legal. This is but a few examples of how people have made what God has declared to be immoral to be moral by making them legal.
But no matter how man tries to make what God has declared immoral to be moral, it's really useless because God's mind doesn't change. God's mind didn't change even with a majority vote. If you think God will change His mind because most people are wrong, you're dead wrong. Remember the warning in Matthew 7:13-14 that only few find the Way to life and so many enter the path of destruction. It's better to be rejected by the world and be right with God than to be accepted by the world and be damned to Hell forever.