Unless this directive violates the terms of an employment contract or union/collective bargaining agreement, or constitutes some form of legally actionable dscrimination, it is legal. The fact is that in an "at will" employment relationship, a company can set the conditions of the worklace much as it sees fit. This includes when and why to terminate an employee. In fact, a worker can be dismissed for any reason or no reason at all, with or without notice.