It’s more likely to be the pain you were in to need the morphine in the first place - plus the inevitable hormone (adrenaline and cortisol) response to what I’m assuming was a stressful situation. Loads of hormones raise blood sugar levels, but only insulin lowers them. Morphine can lower your blood pressure and breathing rate, plus make you nauseous (another response that could stimulate your liver to release glucose).