Is it moral to obey the law?

Bernard Gerts moral rules

"So we now have ten rules:
1. You shall not kill.
2. You shouldn't cause pain.
3. You shouldn't incapacitate.
4. You should not deprive yourself of freedom or opportunity.
5. You should not withdraw pleasure.
6. You should not deceive.
7. You should keep your promises.
8. You shall not cheat.
9. You shall obey the law.
10. You should do your duty. "

Bernard Gert: The moral rules. A new rational justification of morality, Frankfurt a. M. 1983, p. 176

 

“The ten general moral rules listed below account for all of the kinds of actions that are morally prohibited or required. They make explicit that part of the moral system that informs moral agents if some excuse or justification is needed for their behavior. They are formulated to provide a clear and usable description of that part of the moral system.
1. Do not kill.
2. Do not cause pain.
3. Do not disable.
4. Do not deprive of freedom.
5. Do not deprive of pleasure.
6. Do not deceive.
7. Keep your promises.
8. Don't cheat.
9. Obey the law.
10. Do your duty.
All violations of any of these rules without adequate justification are immoral actions. Given the appropriate interpretations, these rules also prohibit all immoral actions. "

Bernard Gert: Common morality. Deciding what to do, Oxford 2004, p. 20.
See Bernard Gert: Morality. Its Nature and Justification, Oxford 1998, p. 216