How can I lose weight while recovering from spinal surgery?

Not the right time. Your body's nutritional needs are increased in the postoperative period. If you start dieting then, you risk poor wound healing. Speak to your surgeon about the right time after surgery to start working on weight loss.
Eat less. If your not exercising, the only way would be to decrease calorie intake.