One reason is that white blood cells (the ones that fight infection) are carried around the body in the lymphatic system. Unlike the blood system where blood is pumped around your body by the heart, the lymph system uses the movement of your body to push lymph fluid around. This is why it is so important to remain active. It is also why people who are confined to bed often find it much harder to fight infections.
Being active doesn't have to be running marathons. Walking is pretty good, as is keeping limbs, hands and feet moving. Whether you move them in bed, on a chair or in the bath, doesn't matter. Just think of those happy white blood cells.