We accept that there is a connection between law and morality, but what sort of connection is it? Their domains are clearly not entirely identical - for example, it may be wrong to lie to your parents, but it certainly is no business of the law. Perhaps the best way to explain this is to acknowledge that the law is an extremely blunt tool.
Law is the mechanism (usually a set of norms/rules with corresponding sanctions) by which we define interpersonal relations. Morality is the categorization of human behaviors as “good” and “bad”, which, is a wholly personal, subjective exercise without recourse to objective moral truth or authority.
It is the governments job to make laws, enforce and govern by them, based on the concepts of justice, equality and rights. These principles are simple and basic in nature, so as not to confuse the whole process with the varying types of religious or personal moralities, which are individual standards based on personal values and faith. The structure of our legal-governing values has to be based on "the rule of law" and equity of results.
The legal maxim of this standard is "equity regards as done what should have been done", or "equity will not suffer a wrong to be without a remedy". This is stating that basically everyone has equal rights under the law and justice is blind and impartial to station, position or wealth.
Basing the governments rule on the ever changing standards of personal morality and social ethics would be a mistake. All cases and legal decisions have to revert back to the simple maxims of law, to dodge the exceedingly complex details of morality based on subjective personal views.
That's why we often see the Law as too literal and unfair, not considering our individually biased viewpoints and emotional judgments. There has to be a common ground that all opinions fall on and settle, as the fairest possible outcome, or nothing would ever be ruled on.