You were right until the second paragraph. Law is a set of easy to apply rules that let us enforce some semblance of our moral/ethical code cheaply and therefore do it at scale. The laws of any given society mostly match its morals. Of course some powerful people and entities get laws that cater to their pet issues but that's the exception, not the norm.