To evaluate the effect of Microbial Induced Calcium Carbonate Precipitation (MICP) on the enhancement of early resistance to sulfate attack of cementitious materials. In this paper, firstly, the effect of Bacillus subtilis (BM) on the carbonation depth as well as the carbonation rate of standard as well as carbonation-conditioned cementitious sand specimens was investigated. Secondly, the compressive strength and volumetric deformation of the specimens at different ages of immersion in sulfate solution were investigated. Finally, the changes of hydration products before and after the addition of BM were analyzed by X-ray diffraction analysis (XRD), and the microscopic pore structure of the specimens after erosion was analyzed by low-field nuclear magnetic resonance (LF-NMR) and scanning electron microscope (SEM), which revealed the mechanism of the improvement of BM on the resistance to sulfate erosion of the cementitious materials. The results showed that the initial compressive strength of BM carbonised curing specimens, ordinary carbonised curing specimens and BM standard curing specimens were increased by 42.0%, 34.0% and 4.0%, respectively, compared with the ordinary standard curing specimens, respectively, compared with the control group, and the loss of the final compressive strength was reduced by 37.4%, 25.4%, and 14.5%, and the expansion rate was reduced by 31.3%, 22.0%, after sulfate erosion for 6 months, 5.2%, and porosity decreased by 24.2%, 13.6%, and 9.9%. Microbial mineralization accelerated the reaction between Ca2+ in the pore solution and atmospheric CO2, and the calcite formed filled the pores to make the structure denser, increasing the initial compressive strength of the specimens and reducing the loss of properties when exposed to sulfate solution. Therefore, the application of MICP technology in cementitious materials provides a new direction for the development of durable and sustainable cementitious materials.