One is primarily companies not wanting to take any risk that IP could walk out the door through off hours work.
The other is that for sufficiently visible and controversial off hours activities, it’s hard to divorce the person 100% from their employer and that’s a PR problem and a distraction many employers are quick to remedy.
When I was an industry analyst, anything I said related to the industry even on a personal blog or Twitter account was (somewhat reasonably) taken as my professional opinion not really separable from what I wrote as part of my job.