In my family's experience, even if you have no pain, hospitals will try to push you into hospice and deny treatment if they deem you "too old" or "too far along." If you as a perfectly coherent patient refuse it and plead for treatment, they will refuse to help you. They push those narcotics because they hasten your demise. Many people in our family have battled cancer, and this is what we have witnessed firsthand.
If a patient is beyond a point of reasonable expectation of recovery, hospice care, not the hospital is the place to be. A hospital is a great place if you are going to get well. It is a horrible place to die.
If you as a perfectly coherent patient refuse it and plead for treatment, they will refuse to help you. They push those narcotics because they hasten your demise.
When there is a treatment with a reasonable expectation of cure, even a very slight one, hospitals offer it, even encourage it. When there is no viable curative treatment, they suggest Hospice for palliative care.
One of the saddest thing to see in a hospital is a patient who knows they have led a full live, one who realizes that death is part of their life process, who is ready to go, being pushed into painful "treatments" by family members. It's often a child who ignored an elderly parent for decades who now wants to "save them."
The morphine is not intended to hasten death. It makes it much less painful. That is what a dying person wants.