There was some disagreement here at the time about whether he was right in his claim that a tweet was not a lawful order. Turns out he was wrong, which almost any serving line officer would have known. An order is an order is an order and is presumed legal. If you receive it and understand it and can execute it, you are bound to execute it, if it comes tied to the back of a gopher.
Spencer knew long before the President's tweet what he wanted. He also ignored that it was the President's final public notice to stop messing around. By the time Spencer was fired both Esper and the President had more than enough of him.