Abortion is clearly and unequivocally condemned, capital punishment is not. The Church considers abortion such an egregious violation of the commandment "Thou shalt commit no murder" as to impose automatic excommunication on any who participate in it. The Church considers the death penalty legitimate in extreme cases, but many Catholics (both clergy and laity) are 'uncomfortable' with its widespread use, on prudential grounds.
There's no real traction for the leftists on the death penalty thing, whereas abortion supporting politicians could possibly be considered already excommunicated. One could consider a legislative vote in favour abortion to be participating in the commission of abortion.
That would make you an accessary before the fact.
In other words the legislator might as well help the abortionist do the deed.