Determining the objective morality of an action itself, without judging the culpability of the person doing it, involves looking at what's called the three moral determinants. These moral parameters are the object or what's actually done, the end or why the deed's done and the various circumstances surrounding the act such as the time or place of the deed. All three parts must be good before the action itself, independent of any personal mitigating factors, can be judged morally permissible.
In Romans 3:8, St. Paul discredits the notion that a person can "do evil, that there may come good." In other words, a good end or purpose doesn't justify using an objectively or intrinsically evil means. Yet situational ethics are the norm today, whereby intrinsic evils such as abortion or euthanasia are done for the good intention or end of alleviating the suffering of some kind.
The object or action itself, ironically, is often the most overlooked moral factor. Moral actions such as participating in contraceptive or homosexual sex and performing abortion or euthanasia are intrinsically or objectively evil — meaning the very act itself is inherently contrary to God's natural design no matter who does them. These actions are always wrong regardless of any good intention or in any circumstance. One cannot, for instance, choose to commit fornication in hopes that it'll lead to marriage or murder the elderly to alleviate their suffering.
An example of telling a joke in a crowded theater with a punch line of yelling fire illustrates all three moral determinants. The object of telling a joke is a neutral or good act in itself. Telling the joke for the sake of humoring someone is a neutral or good intention. The fact that the punchline happens to require yelling the word fire and is done in a crowded theater, are circumstances that render the overall action immoral.
Abortion is always an intrinsically or objectively disordered action. Racism can occur in a morally neutral action like hiring or firing someone if done with a motive of unjust discrimination. Telling a joke that may harm others when done at a certain time or place is immoral owing to the circumstances.
Learn the difference between freedom and licentiousness in this episode of Church Militant's Premium show, Moral Compass—Abortion and Freedom.