Silkworm (Bombyx mori) is an important economic insect. Bombyx mori, which is exposed to sublethal doses of pesticides, has a low or no mortality rate, while it is susceptible to infections triggered by foreign pathogens. The immune regulatory mechanism of silkworms caused by trace pesticides still remains unclear. The midgut is the major organ of silkworm for digestion and nutrient absorption, and it plays a critical defensive role against pathogens. In the present study, the silkworm was susceptible to Enterobacter cloacae sp. (E. cloacae) after exposure to sublethal dose of phoxim. The body weight and survival rate of the phoxim-E. cloacae co-treatment group were significantly decreased after 120 h of treatment compared with the phoxim treatment group. The immune responses and expressions of immune-related genes were dysregulated in the midgut of silkworm following exposure to phoxim. Digital gene expression (DGE) analysis revealed that 44 immune response-related and immune defense-related genes were differentially expressed. qRT-PCR results indicated that the transcriptional levels of antimicrobial peptide genes Bmdefensin1, BmcecA, Bmglv1, Bmglv2, Bmmoricin and BmmoricinB3 were down-regulated by 0.77-, 0.37-, 0.05-, 0.19-, 0.34- and 0.54-fold, respectively. The transcriptional levels of Toll signaling pathway genes Bmcactus, Bmspatzle and Bmrel were down-regulated by 0.4-, 0.37- and 0.96-fold, respectively. Peritrophic membrane (PM) protein-related genes BmCBP-02, BmPM-41, BmPM-43 and BmCDA7 were down-regulated by 0.18-, 0.02-, 0.66- and 0.16-fold, respectively. The expressions of Toll signaling pathway genes were down-regulated at 48 h and 72 h. Immune deficiency (IMD) and Janus kinase and signal transducer and activator of transcription (JAK/STAT) signaling pathway genes were dysregulated after phoxim exposure. These results indicated that phoxim might cause damage to the PM and reduce the immune response of the silkworm, leading to susceptibility of silkworm to disease and damage from foreign pathogens.