There are three fonts (sources) of morality: (1) intention, (2) moral object, (3) consequences.
The Catholic Church teaches that any knowingly chosen act is moral if all three fonts of morality are good, and that any knowingly chosen act is immoral if any one or more fonts is bad. This teaching is found in the Catechism, the Compendium of the Catechism, the USCCB Catechism, and Pope John Paul II’s encyclical Veritatis Splendor, as well as in other sources.
1. Intention — Any act is immoral if it is knowingly chosen with a morally-bad intention. An intention is immoral if, in either the intended end or the intended means, it is contrary to the commandments to love God, and to love your neighbor as yourself.
Voting for a candidate with the intention of legalizing direct abortion, protecting or of broadening existing laws permitting direct abortion, or with any similar intention, is an immoral act under the first font of morality.
2. Moral object — Any act is intrinsically evil when the act, by its very nature, is inherently ordered toward an evil moral object. The moral object of an act is the end, in terms of morality, toward which that act is intrinsically directed. Intrinsically evil acts are always immoral, regardless of intention or circumstances.
Abortion is intrinsically evil; the act of abortion is inherently ordered toward an evil moral object, specifically the direct and voluntary killing of an innocent human person. But voting for a person is not an intrinsically evil act. The act of voting is not inherently directed toward any particular evil law or any particular evil end. The act of voting is directed toward the end of installing particular human persons in offices of public trust.
The fact that a particular candidate favors the legalization of direct abortion, to one extent or another, does not cause voting for that person to be intrinsically evil. The vote does not have the direct effect of causing or authorizing abortions. The moral object of any act is directly related to the nature of the act itself. If voting for a candidate has an effect on laws pertaining to abortion, this is a consequence in the third font of morality, not a moral object in the second font of morality. Therefore, voting for a person is not intrinsically evil.
3. Consequences — Any act is immoral if the reasonably anticipated bad consequences morally outweigh the reasonably anticipated good consequences.
When any act is not intrinsically evil, then its morality depends on intention and circumstances. With a good intention, a voter may morally vote for a pro-abortion candidate, if the reasonably anticipated good consequences outweigh the reasonably anticipated bad consequences of the act of voting. The reasonably anticipated good and bad consequences include the likely effect of the vote on the lives of all persons affected by the vote on all issues in question, including health care, abortion, war, poverty, etc. Any voter may morally vote, with good intention, for whichever candidate will likely do the most good and the least harm.