The major transition to eusociality required the evolution of a switch to canalize development into either a reproductive or a helper, the nature of which is currently unknown. Following predictions from the ‘theory of facilitated variation’, we identify sex differentiation pathways as promising candidates because of their pre-adaptation to regulating development of complex phenotypes. We show that conserved core genes, including the juvenile hormone-sensitive master sex differentiation gene doublesex (dsx) and a krüppel homolog 2 (kr-h2) with putative regulatory function, exhibit both sex and morph-specific expression across life stages in the ant Cardiocondyla obscurior. We hypothesize that genes in the sex differentiation cascade evolved perception of alternative input signals for caste differentiation (i.e. environmental or genetic cues), and that their inherent switch-like and epistatic behavior facilitated signal transfer to downstream targets, thus allowing them to control differential development into morphological castes.