That is NOT how ethics work. A deontological system of ethics or morals is simply one in which the rules are absolutes, and they are given to us, externally. Hence the prefatory root of the term “deo,” which originally meant to refer to a god. In other words, deontological ethics refer to things being ethical because we are TOLD they are. And, as the name suggests, this is only a proper approach to morality/ethics, when in fact the rules are being promulgated by a divine being. Laws, being made by other flawed humans, are a poor source of ethics for other humans. This becomes especially apparent if you truly know the reasons behind some policies and laws.
I remember, doing research for a paper on international human rights law, and discovered a memo from an attorney at the DoD under Donald Rumsfeld, who had suggested that the Bush Administration should argue in court that Guantanamo was not US jurisdiction for the purposes of habeas corpus, but, that the Administration should simultaneously argue that it was US jurisdiction for the purposes of the Alien Tort Claims Act (which allows a foreign national to sue in US federal court for claims which arise in a foreign jurisdiction and violate international law or US treaties). Moral of the story? Laws and policies are crafted and interpreted for some of the most cynical, and abhorrent reasons imaginable and are hardly a guide for ethical behavior.
Moreover, as has been pointed out, societal attitudes shift, and laws are often slow to catch up to societal shifts. Even more to the point, in the US in particular, we have a severely anti-majoritarian system, made worse through gerrymandered districts that allow, in essence, to quote a visiting British parliamentarian “the politicians to choose their voters.” 50% of the US Senate represents less than 25% of the population.
This is evident when you look at an issue like, quite timely, gun control. Over 60% of the country favors tons of restrictive measures that don’t even have a snowball’s chance in hell of making it to the floor for DEBATE, let alone passage. Laws in THIS country, at least, do not begin to reflect the ethical views of the society at large.
Again, would that even matter? If a majority believe it to be moral would that make it acceptable? A majority once believed non-whites were less fully human than whites. A majority also believed, when they founded this country, that only white males, who owned land, and were 25, should have a say in their own governance.
What makes something moral? Honestly, I wrote my thesis on the subject, and couldn’t give you a straight answer. I know what DOES NOT make something moral: being codified into law, or being believed by a lot of people.