Cordyceps militaris is a filamentous fungus used for both medicinal and culinary purposes. It exhibits a wide range of pharmacological activities due to its valuable contents of cordycepin, polysaccharides, carotenoids, terpenoids and other metabolites. However, C. militaris strains are highly susceptible to irreversible degradation in agricultural production, which is often manifested as a prolonged color change period and a significant decrease in the production of secondary metabolites. UDP-glycosyltransferases are an important enzyme family that participates in the synthesis of terpenoids by performing the glycosylation of key residues of enzymes or molecules. However, few studies have focused on its effect on the regulation of metabolite production in C. militaris. Therefore, in this study, we performed transcriptome analysis across four different developmental stages of C. militaris to target the putative glycosyltransferase gene CmUGT1, which plays important roles in metabolite production. We further constructed and screened a CmUGT1-overexpressing strain by Agrobacterium tumefaciens-mediated infestation of C. militaris spores. The major metabolite production of the wild-type and CmUGT1-overexpressing C. militaris strains was determined after short-term shake-flask cultivation of mycelia. The results showed that the yields of carotenoids and polysaccharides in the mycelia of the CmUGT1-overexpressing strains were 3.8 and 3.4 times greater than those in the mycelia of the wild type, respectively (p < 0.01). The levels of intracellular and extracellular cordycepin produced by the overexpression strain were 4.4 and 8.0 times greater than those produced by the wild-type strain (p < 0.01). This suggests that the overexpression of CmUGT1 in C. militaris enhances the synthesis activities of the main enzymes related to metabolite production, which provides a guide for obtaining excellent recombinant strains of C. militaris.