I wholeheartedly agree with your comment. The core is that OP created something of value, in his own time. So there should be a value exchange of some sort.
Which, depending on case law in a particular jurisdiction, may or may not actually be enforceable. This is exactly why you would want to talk to a lawyer: they can tell you if you have a leg to stand on.
The employer might be under the impression that all the terms in the employment contract they pulled off FreeLegalTemplates.net are enforceable when they aren't. Going to a lawyer first gives you the ammunition to politely point out that you are in fact the one in the right here.
Unless he’s a salary employee. In that case, he’s technically always on the clock or could be argued to be so. If you want your time to yourself then stay an hourly employee.
IANAL, but it's definitely not that simple. I've worked in salaried positions and still retained ownership of my side projects. There was also one instance where I refused to sign a NCA that threatened my IP, so YMMV.
A salaried position is usually for X hours per month though. An employer that can make you work 24/7 each day of the month is not an employer, they're an owner.