Unless the company’s rules of employment specifically prohibit it (which it may) this looks like a slam dunk wrongful termination suit in the making
If you're working remotely -- providing your own office, setting your own hours -- are you still an employee? Aren't you really an independent contractor?
In many professional fields it is almost universally prohibited under the terms of an employment agreement. At a bare minimum, there would be an ethical obligation to notify both employers of the arrangement — since it carries an enormous risk for conflicts of interest.
In the absence of a contract for a specific term of employment, the employees were "at will," which means they can be terminated for any reason or no reason at all, as long as the termination not for an illegal reason (i.e., termination because the person belongs to a protected class or is a whistleblower).