Here is the American Medical Association's position on abortion:

The Principles of Medical Ethics of the AMA do not prohibit a physician from performing an abortion in accordance with good medical practice and under circumstances that do not violate the law.

Here is its position on capital punishment:

An individual’s opinion on capital punishment is the personal moral decision of the individual. A physician, as a member of a profession dedicated to preserving life when there is hope of doing so, should not be a participant in a legally authorized execution. Physician participation in execution is defined generally as actions which would fall into one or more of the following categories: (1) an action which would directly cause the death of the condemned; (2) an action which would assist, supervise, or contribute to the ability of another individual to directly cause the death of the condemned; (3) an action which could automatically cause an execution to be carried out on a condemned prisoner.

Physician participation in an execution includes, but is not limited to, the following actions: prescribing or administering tranquilizers and other psychotropic agents and medications that are part of the execution procedure; monitoring vital signs on site or remotely (including monitoring electrocardiograms); attending or observing an execution as a physician; and rendering of technical advice regarding execution. In the case where the method of execution is lethal injection, the following actions by the physician would also constitute physician participation in execution: selecting injection sites; starting intravenous lines as a port for a lethal injection device; prescribing, preparing, administering, or supervising injection drugs or their doses or types; inspecting, testing, or maintaining lethal injection devices; and consulting with or supervising lethal injection personnel.

The following actions do not constitute physician participation in execution: (1) testifying as to medical history and diagnoses or mental state as they relate to competence to stand trial, testifying as to relevant medical evidence during trial, testifying as to medical aspects of aggravating or mitigating circumstances during the penalty phase of a capital case, or testifying as to medical diagnoses as they relate to the legal assessment of competence for execution; (2) certifying death, provided that the condemned has been declared dead by another person; (3) witnessing an execution in a totally nonprofessional capacity; (4) witnessing an execution at the specific voluntary request of the condemned person, provided that the physician observes the execution in a nonprofessional capacity; and (5) relieving the acute suffering of a condemned person while awaiting execution, including providing tranquilizers at the specific voluntary request of the condemned person to help relieve pain or anxiety in anticipation of the execution.

Physicians should not determine legal competence to be executed. A physician’s medical opinion should be merely one aspect of the information taken into account by a legal decision maker such as a judge or hearing officer. When a condemned prisoner has been declared incompetent to be executed, physicians should not treat the prisoner for the purpose of restoring competence unless a commutation order is issued before treatment begins. The task of re-evaluating the prisoner should be performed by an independent physician examiner. If the incompetent prisoner is undergoing extreme suffering as a result of psychosis or any other illness, medical intervention intended to mitigate the level of suffering is ethically permissible. No physician should be compelled to participate in the process of establishing a prisoner’s competence or be involved with treatment of an incompetent, condemned prisoner if such activity is contrary to the physician’s personal beliefs. Under those circumstances, physicians should be permitted to transfer care of the prisoner to another physician.

Organ donation by condemned prisoners is permissible only if (1) the decision to donate was made before the prisoner’s conviction, (2) the donated tissue is harvested after the prisoner has been pronounced dead and the body removed from the death chamber, and (3) physicians do not provide advice on modifying the method of execution for any individual to facilitate donation.

So participation in abortion is permissible, but participation in capital punishment is not. Can you imagine anything more perverse? It might be said that abortion is legal. True enough, but so is capital punishment. It might be said that not all people convicted of murder are guilty. True enough, but then, not all fetuses are guilty.

Addendum: Perhaps this perversity partly explains why less than a third of practicing physicians (perhaps as few as a sixth) are members of the AMA. Who would want to belong to an organization that purports to be an organization of physicians (the AMA's "core purpose" is "To promote the science and art of medicine and the betterment of public health") but in fact exists to promote politically progressive policies? The AMA, for example, supports the individual mandate, which, besides being unconstitutional, is a gross infringement of individual liberty.