When the leg is kept still the blood flows sluggishly through the veins back to the heart. Normally when one is walking the rhythmic contraction of the muscles behind the calf aid the circulation of blood, but this cannot happen in bed if the leg is kept still.
The problem with sluggish blood flow, especially after injury or surgery, is that clots can form in the veins. This is called deep vein thrombosis - DVT. It is a potentially serious problem because such clots can break off and shoot up to the heart and into the lungs, stopping the blood flow to the lung tissue.
A number of things are useful to prevent DVT while in bed: