The defence secretary’s departure was the wrong resignation at the worst possible time for the prime minister