Morality serves as the ethical basis or justification for law and facilitates obedience to the law by fomenting habits of conduct. Western Kentucky University explains that morality precedes law and is necessary for law to be successful.
According to Western Kentucky University, morality consists in what is naturally the right thing to do, whereas law is the civil codification of public conceptions of morality. People make laws according to their beliefs of good and evil, right and wrong. Laws either have the goal of promoting good behavior or punishing undesirable behavior. Thus, morality informs the law.
Nevertheless, law and morality are not identical. Many philosophers and scholars of ethics posit that morality is objective. Moral standards do not change. Law, on the other hand, is changeable according to the desires of lawmakers. The laws of a state do not necessarily conform to the moral law. Throughout history, for example, there have been laws sanctioning practices like slavery, spousal abuse and murder.
Western Kentucky University additionally observes the important role of public morality in preserving lawfulness among citizens. Enforcement of the law depends upon the threat of physical force. People obey the law out of fear of being deprived of their life or property. However, people who only obey out of fear of punishment look for ways to break the law without being caught. The best way to achieve obedience to the law is for people to internalize the moral principles that underlie the law. When people do so, they obey the law even when no one is watching.