A prison doctor takes on a serial murderer as a patient. This patient is violent and has continued to harm others while incarcerated and will likely do so on the outside if he is paroled. The patient now presents with a disease which, if left untreated, will kill him but be beneficial to society. The doctor could either allow the disease to run its natural course or intervene and save a person who will likely go on to cause more harm to others.
An emergency room doctor in a small community hospital sees a patient who is admitted for an acute, life-threatening illness. This patient is a chronic alcoholic and polydrug abuser who presents frequently, has never held a job for his entire life, and lives his life fully on the off of other peoples' charity and tax dollars. During his hospitalization, it is discovered that the patient possibly has a separate, life-threatening disease which requires subspecialist care is very expensive to treat. The doctor could work the patient up for the other life-threatening disease and refer the patient to an expensive tertiary care center for appropriate treatment, or merely stabilize the patient's acute issue and allow the patient's other condition to kill him, thus likely saving the community several hundreds of thousands of dollars (at least).
An orthopedic surgeon agrees to see a patient with diabetes and gangrene of the right lower extremity. The patient does not work but has stated a preference to be able to keep as much of her leg as possible. The surgeon determines that he can attempt a BKA to retain maximum function for the patient afterwards, but that there is a chance that he will have to follow up with an AKA afterwards if the blood supply does not extend all the way down to the stump after the BKA, which would be much more expensive than just doing the AKA to begin with. He can either proceed with the BKA, which would save society valuable public healthcare resources, or the AKA, which is consistent with the patient's goals but presents the risk of higher costs to society.
An OB/GYN is performing a repeat caesarean section on a single mother who is a unable to support her existing two children without public support. The patient has refused a tubal ligation and expressed a wish to have more children in the future. After the infant is delivered, the uterus continues to bleed at a much higher rate than expected along the incision. The doctor has been trying to stop the bleeding by throwing additional sutures for several minutes without success and the uterus is starting to become atonic; the patient's heart rate is increasing and there is somewhat of a drop in blood pressure. He can either call the blood bank and prepare for possible transfusion, administer more pitocin and continue to try to stop the bleeding for as long as the patient can tolerate it or he can do the best thing for society and perform a hysterectomy, thus ending both the incisional bleeding and the patient's ability to reproduce.
These are not hypothetical; I have observed these exact situations while on rotations. In every case, the physician ended up acting in the patient's best interest. And I believe that they were right to do so.
It is absolutely the physician's duty to put his patient's well-being above that of the rest of society when it comes to making decisions about patient care. This idea is fundamental to developing trust in the physician-patient relationship. If I were a patient myself, I would be much more trusting of a doctor who puts my well-being above the "social good" than one who views taking care of me as his second priority.