We classify an action by its object (its objective essence). When an action’s object is evil—such as murder, the killing of an innocent human being—it is morally evil to do it. A particular choice can also be evil in its subjective dimension (motive or intention) or when circumstances (or accidents) make the choice evil. A choice is only good if its object, motive, and circumstances are all good.
The object of a human action is what a particular action objectively “says”, especially in relation to the person we love. If I point a gun at someone and pull the trigger, even if the gun doesn’t fire, I “say” something evil to that person (doing so as a joke with an obviously toy gun is not the same as doing so with a real gun that just doesn’t fire). It is not so much what physically happens that determines the object but the objective message that is communicated to God and to the other person: “I wish you were dead… I consider your life as an obstacle to my happiness and personal fulfillment.”
The action’s intention—the motive behind the message—is also important. It is the action’s subjective dimension: what one wills or desires in doing the act (see CCC 1752-53). The object of a kiss is to communicate and express one’s love—something good—but Judas intended to use a kiss to betray Jesus and hand him over to those who would kill him (see Mark 14:44). Judas’ evil motive made the good object into an evil act. Likewise, a politician may go to church and receive Holy Communion to look good and win votes, while supporting abortion and other evils. Here the intention desecrates the holiest of actions. So the Catechism of the Catholic Church says: “An added bad intention (such as vainglory) makes an act evil, that in and of itself, can be good (such as almsgiving)” (CCC 1753).
St. John Paul II says: “An intention is good when it has as its aim the true good of the person in view of his ultimate end” (Veritatis Splendor). In other words, when the action’s motive is to help others get to know, love, and serve Jesus Christ and to help them get to heaven.
Some actions (objects) are intrinsically evil by their very nature and so can never be justified, such as abortion, adultery, deliberately killing innocent life, euthanasia, slavery, etc. As the Catechism says:
There are some concrete acts—such as fornication—that it is always wrong to choose, because choosing them entails a disorder of the will, that is, a moral evil (CCC 1755). There are acts that, in and of themselves, independently of circumstances and intentions, are always gravely illicit by reason of their object; such as blasphemy and perjury, murder and adultery. One may not do evil so that good may result from it (CCC 1756).
Having “good motives” doesn’t make acts with evil objects suddenly good, because it is never lawful to do evil to make good come of it (see Romans 3:8), even if one intends to promote the welfare of an individual, of a family, or of society in general. This is seen in some moral axioms: the ends do not justify the means, or never do evil to attain good, or you can’t rob the rich to give to the poor.
Circumstances (the who, what, when, where, why, and how) surrounding a human act also may impact its morality, as the Catechism says:
The circumstances including the consequences, are secondary elements of a moral act. They contribute to increasing or diminishing the moral goodness or evil of human acts (for example, the amount of theft). They can also diminish or increase the agent’s responsibility (such as acting out of fear of death). Circumstances of themselves cannot change the moral quality of acts themselves; they can make neither good or right an action that is in itself evil (CCC 1754).
For example, cursing in a church is a greater offense than cursing while driving in a car: cursing in God’s presence and in the presence of those trying to pray profanes as well as offends. Likewise, using a weapon to steal becomes armed robbery, which is more serious.
All our free actions have a message that is either good or evil, never indifferent. For the message to be good, it must have a good object, intention, and circumstances together.