doublesex regulates early embryonic sex differentiation in holometabolous insects, along with the development of species-, sex-, and morph-specific adaptations during pupal stages. How does a highly conserved gene with a critical developmental role also remain functionally dynamic enough to gain ecologically important adaptations that are divergent in sister species? We analyzed patterns of exon-level molecular evolution and protein structural homology of doublesex from 145 species of four insect orders representing 350 million years of divergence. This analysis revealed that evolution of doublesex was governed by a modular architecture: Functional domains and female-specific regions were highly conserved, whereas male-specific sequences and protein structures evolved up to thousand-fold faster, with sites under pervasive and/or episodic positive selection. This pattern of sex bias was reversed in Hymenoptera. Thus, highly conserved yet dynamic master regulators such as doublesex may partition specific conserved and novel functions in different genic modules at deep evolutionary time scales.