Sometimes the saying is correct, as when the Allies decided in World War II to side with Josef Stalin against Adolf Hitler.
Hitler was a jerk. He deserved whatever self destruction he wrought . Stalin was much worse and Marxism was much worse than nazism.