And if your employer tells you to kill another employee, do you obey that illegal order and do so?
Not analagous. When I agreed to work for my employer I agreed to follow rules that are more restrictive than what I can do outside of work. That's a legal contract. Telling me to do something illegal is outside the bounds of the contract. I don't think you can even include something illegal in a valid contract.