Generally long term
morphine use doesn't cause any problems. One thing that the weight gain could be from is inactivity.
Morphine can cause you to have sugar cravings. So if your in a lot of pain and taking morphine, you may not be moving around to much.
If you can get out and go for a walk twice a day it would be very beneficial. Walking promotes endorphin production which help us feel normal and happy.
So if you can, get active, stay away from sweet binging and eat a high protien diet. Good luck and I hope your pain is under control......Dave