The topic of morality is often brought up in how it interacts with the law. Issues such as same-sex marriage, abortion, capital punishment and even taxation all have some hint of morality embedded in them. All these hot-button issues typically invoke a visceral response from most people. Still there are some issues which are almost universally regarded as immoral. For example, I would assume, if not expect, all would agree with the sentiments of California Civil Code § 3517, which states "No one can take advantage of his own wrong."
The Probate Code has a similar statute, in that it punishes those who commit an immoral act, namely the feloniously killing of another human being. This is known as California's slayer statute. It should be noted that the killing of another must be considered a felonious act. In other words, if you kill somebody in self-defense, justifiable homicide, this would not be considered a felonious killing. Conversely, if you murdered somebody, this would be considered a felonious killing.
(a) A person who feloniously and intentionally kills the decedent is not entitled to any of the following: