Doctor here- sleeping is not sitting stationary in a plane seat where you can barely move even if you wanted to. As others have said, you move during your sleep (even if you don’t think you do, you do) and movement of the leg muscles helps blood flow back from your feet in the veins of your legs.