Animal diversity is shaped by the origin and diversification of new morphological structures. Many examples of evolutionary innovations are provided by male-specific traits involved in mating and sexual selection. The origin of new sex-specific characters requires the evolution of new regulatory interactions between sex-determining genes and genes that control spatial patterning and cell differentiation. Here, we show that sex-specific regulation of the HOX gene Sex combs reduced (Scr) is associated with the origin and evolution of the Drosophila sex comb - a novel and rapidly diversifying male-specific organ. In species that primitively lack sex combs, Scr expression shows little spatial modulation, whereas in species that have sex combs, Scr is upregulated in the presumptive sex comb region and is frequently sexually dimorphic. Phylogenetic analysis shows that sex-specific regulation of Scr has been gained and lost multiple times in Drosophila evolution and correlates with convergent origin of similar sex comb morphologies in several independent lineages. Some of these transitions occurred on microevolutionary timescales, indicating that HOX gene expression can evolve with surprising ease. This is the first example of a sex-specific regulation of a HOX gene contributing to the development and evolution of a secondary sexual trait.