I was a bit harsh (and rightly so) in my discussion of some of the mistakes made about natural law theory in Murphy and Coleman's Philosophy of Law: An Introduction to Jurisprudence. There is, however, one interesting passage I wish to discuss a bit more fully:
"People are often called upon to recognize their moral obligation to obey the law in those cases where they morally disagree with the law--e.g., the law perhaps requires that they fight in a war they regard as evil or requires that they accept a way of life, say racial integration, that they regard as contrary to the common good. It is unclear how natural law theory will illuminate such cases. Such cases may be understood, however, when one realizes that foundations for moral obligation other than morality of content may be possible. Consider promises. My moral obligation to keep my promise is generated by the act of promising, not by the content of what I promise. My helping you paint your fence is morally trivial and, by itself, generates no moral requirement for me. If I promise to help you pain the fence, however, then my doing it takes on the character of a moral requirement. Is there any important analogy between the obligation to obey the law and the obligation to keep a promise? Social contract theory claims yes, and this shows that it is at least possible that grounds for the moral obligation to obey the law other than those favored by natural law theory might be articulated." (pp. 17-18).
Now, it is clear that if you find it unclear how natural law theory illuminates the cases noted in the passage, one thing to do is to look at how natural law theory of one form or other has actually operated in such cases; for there is no doubt that it certainly has. But this is not the part of the passage that most interests me; rather, what I think is worth noting, and what I think shows the fatal flaw(s) in Murphy's approach to natural law theory.
1) It is clearly false to say that the obligation of a promise is generated by the act of promising rather than by the content of the promise. Immoral promises do not bind; and it would be perfectly reasonable to say, in parallel to what Aquinas says about laws, that promises to do evil things are not promises but perversions of promises. They have the act of promising to suggest they might be classified as 'promises'; but they don't have the moral force of a promise, which suggests they are not, morally speaking, promises, even if they are considered to be promises in virtue of the act of promising. To obligate us, a promise must be consistent with (guess what!) natural law. Likewise, if a legislature passes an unjust law, it is a 'law' in the sense that it was created by an act of legislation by an authority that intended it to have force of law. But if it is unjust it is, morally speaking, not a law but a perversion of law, and that means it does not obligate, anymore than an immoral promise obligates.
2) Is there an analogy between the obligation in a promise and the obligation in a law? More than an analogy, they are variations of the same thing - that is, they derive from the authority of natural law (the first principles of moral reasoning). This brings me to the second point. Social contract theory cannot be an alternative to natural law; it can only be an additional specification. Social contract theory needs some basis, some framework, within which it may regard contracts or promises as have obligatory force, i.e., authority. If you look at many of the early social contract theorists, you will find that they are well aware of this, and often, in fact, are natural law theorists of one stripe or other, or, if not, borrow from the natural law tradition in order to make this or that point. If you look at the foundation of any social contract theory, you will find principles that look suspiciously like attempts to formulate natural law. This is true of any purported 'alternative'. Unless you are going to try the (apparently impossible) feat of building a moral theory without any principles at all, you will come back to something like natural law. There's no escaping it, for the same reason there's no escaping the need for a moral theory to recognize that something like "Good ought to be done and evil ought to be avoided" is obvious and undeniable.