Right and wrong and whether to break the rules are two different things  There may be provisions prohibiting things that are not wrong in themselves, for example, the laws of some countries prohibit criticizing the government, or there may be provisions requiring the implementation of things that are inherently wrong, for example, some laws require apartheid in public places
And, like the evaluation of behavior, we can also evaluate some of the provisions of the right and wrong
The judgment of right and wrong is based on the moral conscience of oneself and others, which is common and universal, while the moral rules on how to behave vary from time to time and place to place.