There may be a link here. Bacterial infection of any joint can occur whenever there has been damage to the joint. Since bacteria are carried through the body via the bloodstream, you may have been at increased risk from both the torn rotator cuff and lack of movement without the exercises.
Movement and exercise helps keep the blood flow moving to various body parts. The blood helps carry dead cells, bacteria, and other debris away from the joint.
The older you are, the more likely you are to be affected. Other risk factors for joint infection include illness or disease such as heart disease, liver disease, diabetes, or treatment with chemotherapy for cancer.