This is 100% legal, unless there is some written employment or other agreement barring it. In the absence of a contract to the contrary, the managers of a company have free rein to decide what work to have employees do, and the law does NOT require that a company make good or profitable decisions.