Plenty of people work more than one job. As long as someone does the work that's expected of them and performs their job duties well, it isn't any employer's business what someone does in their time off.
If companies don't want employees working for anyone else, then they should compensate those employees for that privilege. They don't own anyone's free time unless they pay for that privilege.
Let's say you work strict hours 9am to 5pm M-F. On Thursday at 8:47pm you happen to think of a solution to a problem you're having at work. Are you suggesting the company should pay you more because the idea occurred outside of your strict hours?
In general, companies pay white collar workers / knowledge workers, for their knowledge. That happens regardless of when that knowledge is acquired. It seems pretty common sense and there are also plenty of laws to it up. Any other arrangement would seem full of issues.