The main reason not to code on evenings and weekends is that your employer will own everything you do and might not allow you to do whatever you want anyway.
Depends on the state and the terms of employment you agreed to. I’ve never agreed to let an employer own anything outside of a very specific scope. And I’ve rarely had to turn down a job because of that constraint. Employers have almost always had a reasonable scope with respect to what they own to begin with or have been fine with changing the scope to be more reasonable.