There are contractual terms, including things that are likely to be conflict of interests or impact performance. And depending on jurisdiction there are also laws on working hours: 48 hours max. per week on average in the UK and EU across all jobs (it is possible to opt out) and with minimum rest times. Because employers can be held liable, if they find out they won't let you.
The comment I was replying to does not make sense.