IANAC, but to expand on Bricker’s point, the Catholic church teaches that is always wrong to set a goal of harming an innocent person. (The technical wording is that one may not “intend” to harm an innocent person.) One may set other goals that one knows will unfortunately harm innocent people, but causing harm to them can never be the part of the goal, no matter what. You can say, “If I blow up Dr. Evil’s lair, innocent people will be killed in the explosion, but it’ll save the world, so it can’t be helped.” You can NOT say, “If I kill this one innocent person (say, a baby who would cry and wake Dr. Evil’s minions) I will be able to destroy Dr. Evil’s lair and save the world with no one else getting hurt. Otherwise, everyone will die, so I’d better do it.” In the former case, innocent people dying is not part of your goal, even though you know it will happen if you act. In the latter case, killing an innocent person is part of your goal (even if it’s just an intermediate step to saving the world) and that is morally wrong no matter what according to Catholic doctrine.
Since abortion, by definition involves killing what the Catholic church believes is an innocent person, there is no way for abortion to be morally allowable in any situation, ever, no matter what. Not even to save the mother’s life. (Though if in saving the mother’s life, the fetus is accidentally aborted, that’s allowable, even if you knew it would happen. God will know the difference and presumably so will the doctor doing it, even if no one else does.)
War, social justice, the death penalty, all those are different. The Catholic Church generally believes war is wrong, but it acknowledges that there are situations where it is justified. Even if the Catholic Church says that this particular war is wrong, you might disagree, not on the doctrine, but on the facts. Same with the death penalty. The Church says, as part of it’s moral teaching, that the death penalty is only morally allowable where it is absolutely necessary to preserve social order. The Church also takes the position that this is not the case in any modern society, but that’s a position on the facts, not a moral teaching per se.
That means that if a politician says that we should invade Canada, it doesn’t necessarily mean that he’s a bad person. He might agree with Catholic morals, and just be extremely misinformed about the situation in Canada, such that he thinks it justifies a war under Catholic doctrine. Same for all the other stuff. EXCEPT abortion. If a politician is in favor of allowing abortion, then he disagrees with a fundamental moral teaching of the Church, in other words, he holds a basically immoral position.
Most Catholics, including most bishops, seem to have generally believed that it is up to the individual voter to decide if the guy wanting to invade Canada is really that misinformed about Canada (but still a good person) or if he’s actually rejecting Catholic moral teaching, and likewise whether the guy wanting to keep abortion legal really thinks abortion is morally permissible or if he just thinks that outlawing it will lead women to have dangerous back-alley abortions but won’t reduce their number. Also, I believe, though I may be wrong, that the voter was allowed to choose between a moral idiot who wants to start wars and a morally bankrupt person who nevertheless would practice good governance that would further morally good goals.
Recently, some bishops and lay Catholics have begun arguing that because abortion is such a clear case of moral depravity, that acceptance of it cannot be countenanced. This is a break from earlier teaching and from the stated position of the Vatican, but it seems to be becoming more common.