I don’t have that problem because the more I move the more pain my pain will increase, and it’s really bad sickening pain too, not bareable kind of minor pain.
But for some people, it could be due to boredom, or feeling guilty for doing nothing especially when something needs to be done or because of a medical condition called “restless leg syndrome”.