Why are people tired after surgery?
Answers in comments are correct. The tail effect of hypnotic drugs combined to opiates given for pain relief will make you feel really tired just after surgery.

But if you are referring to a more long-term effect, such as feeling tired for several days after surgery, then several factors combine:


psychological stress
physical deconditioning: inpatients usually do not move much. And even a few days of immobility will have a huge impact on your physical abilities. That is why in modern medicine, every effort is made to make the patient move as quickly as possible. Intensive physical therapy, readaptation therapy, and fast-track pathways are a result of this effort.
physical stress: undergoing surgery is a physical effort. Your body needs to accommodate for large shifts in volemia, positive pressure ventilation, reaction to pain (which still takes place during anesthesia), etc. The physical abilities of the patient are evaluated by the anesthesiologist for that reason, using MET effort units (often measured in number of flights of stairs you can climb without stopping). People with angina pectoris or diagnosed atherosclerosis can also be submitted to an ergometric test (cycling) or stress echocardiography/scintigraphy to evaluate if their heart can tolerate the physical stress of surgery.