Why is it so common to pull the plug on terminally ill patients?

Hear me out. An aunt of mine was braindead for a few weeks before the doctors and family decided to pull the plug. Sounds reasonable, right? So why do they let these patients die by asphyxiation when it's way more humane to kill them with an overdose of morphine??? Her daughter had to watch her struggle to breathe for 10 minutes straight! I don't know how doctors can know this is gonna happen and still choose to do that instead of killing them mercifully.