That's the US where fear of a lawsuit overrides everything else. The patient had been pronounced dead by a physician, had the doctor advised the Captain to divert but the flight continued and the patient died a few hours later it would be a whole different matter.
Some long haul aircraft even have a special storage area for a body in the event that someone dies in flight.