Because every piece of biological function that can be retained is one less act for the patient to re-learn and for a prosthetic to replicate.
Removing a patient's knee and below means a more expensive artificial limb with more joints compared to foot removal only.
By retaining the operating knee joint where possible allows the patient as much function as they can have to assist with recuperation, both physical and mental.
Additionally, the knee is a weight bearing joint when assembled. The bare bottom end of the femur is not well-suited to taking loads when not mated with the rest of the knee.
And there is less flesh in this area, so the blood supply is not conducive to growing healthy flesh over the stump either. When the leg is cut above the knee, the bone is cut a little higher and the thigh muscle/flesh is used to cover the stump. There is far less meat in the knee to close the hole.
(source, my Grandad had a foot removed. He'd also had a steel knee installed earlier, which limited blood flow to the stump and it simply starved. So he had an above-knee amputation and could not adjust to a longer leg, ended up in a wheelchair for the rest of his life.)