Biases in synonymous codon use occur across multicellular organisms. Optimal codons, defined as those most commonly used in highly transcribed genes, are thought to arise from selection for cost-efficient translation, which would favor codons with abundant matching tRNAs. Such presumed selection is described as optimal codon choice. Non-optimal codons, defined as those least commonly used in highly transcribed genes, may in principle also play important roles, including regulating protein folding or mRNA translation. However, the dynamics of non-optimal codon use remain understudied. Here we rigorously examine non-optimal codon use, using sex-biased genes expressed in the gonads of Drosophila melanogaster as a case study. Using this model, we show that as genes evolve sex-biased expression, they tend to evolve a preference for non-optimal codon use, and that this preference is stronger for testis-biased genes than for ovary-biased genes. Further, from thorough analyses of each of 18 degenerate amino acids, we found evidence that the use of non-optimal codons is not random. Instead, specific non-optimal codons are favored over their synonymous non-optimal codons, an effect again especially pronounced in testis-biased genes. Moreover, we found that non-optimal codon use is positively linked to elevated disorder of the encoded proteins, a pattern most consequential in testis-biased genes. Remarkably, all 18 degenerate amino acids were associated with higher disorder when they were encoded by the identified primary non-optimal codon, than when encoded by its sister optimal codon. We hypothesize that selection may have acted to promote non-optimal codon choice to regulate translation. We discuss the putative roles of tRNA gene copy numbers, pleiotropy, and sex-biased expression in the evolution of this level of gene regulation.