Laws are about one thing and one thing only. But before I go into that, I will put this up as a foreword:
social contract
n.
An agreement among the members of an organized society or between the governed and the government defining and limiting the rights and duties of each.
Now for the main thing. There is no such thing as an objective evil/wrong. What is considered 'evil' is
entirely based on the morals that you have come up with. The closest to objective 'evil' that you can get is something that is done maliciously with no benefit, but there is
always a benefit. Anyway, purpose of law is to keep the citizens of a nation within the boundaries of the common morals held by that society. This is why laws preventing, say, homosexual marriage are not
bad. If the majority of the society believes that homosexuality is wrong, then it is. If the majority of society accepts homosexuality, then it's not.
This concept is present within the legal system itself. Laws are open to change, because the morals held by a society are constantly in flux. Being openly Communist was a heinous crime not so long ago within the US, but it's no longer such a strong concern, so now it is not.
To tl;dr it, the law is right 100% of the time. It doesn't matter
what the law is, if you live in that country, then you are expected (And should) follow the law. In many countries nowadays, you're free to argue against said laws, and even try and have them changed. But as long as the law is still law, then it should not be broken under any circumstance. Small note: The law is rarely changed because people break it. IE Protesting laws against marijuana with a blunt in your hand isn't very effective for the same reason that we don't allow convicted felons to vote. If you break the law, then you should have no say in whether or not it gets changed because you have not shown the self-control and acknowledgement of personality responsbility to make those decisions.