“....it's perfectly okay for the state to legislate that doctors (who swear an oath to save lives, or used to)....”

Actually the [Hippocratic] Oath states: “Do No Harm.” I submit that prolonging the suffering of a terminally ill patient against his/her wishes is indeed doing harm.