Erythritol has shown excellent insecticidal performance against a wide range of insect species, but the molecular mechanism by which it causes insect mortality and sterility is not fully understood. The mortality and sterility of Drosophila melanogaster were assessed after feeding with 1M erythritol for 72 h and 96 h, and gene expression profiles were further compared through RNA sequencing. Enrichment analysis of GO and KEGG revealed that expressions of the adipokinetic hormone gene (Akh), amylase gene (Amyrel), α-glucosidase gene (Mal-B1/2, Mal-A1-4, Mal-A7/8), and triglyceride lipase gene (Bmm) were significantly up-regulated, while insulin-like peptide genes (Dilp2, Dilp3 and Dilp5) were dramatically down-regulated. Seventeen genes associated with eggshell assembly, including Dec-1 (down 315-fold), Vm26Ab (down 2014-fold) and Vm34Ca (down 6034-fold), were significantly down-regulated or even showed no expression. However, there were no significant differences in the expression of three diuretic hormone genes (DH44, DH31, CAPA) and eight aquaporin genes (Drip, Big brain, AQP, Eglp1, Eglp2, Eglp3, Eglp4 and Prip) involved in osmolality regulation (all p value > 0.05). We concluded that erythritol, a competitive inhibitor of α-glucosidase, severely reduced substrates and enzyme binding, inhibiting effective carbohydrate hydrolysis in the midgut and eventually causing death due to energy deprivation. It was clear that Drosophila melanogaster did not die from the osmolality of the hemolymph. Our findings elucidate the molecular mechanism underlying the mortality and sterility in Drosophila melanogaster induced by erythritol feeding. It also provides an important theoretical basis for the application of erythritol as an environmentally friendly pesticide.