Desertification leads to the extreme fragility of ecosystems and seriously threatens ecosystem functioning in desert areas. The planting of xerophytes, especially leguminous shrubs, is an effective and common means to reverse desertification. Soil microorganisms play a crucial role in nutrient cycling and energy flow in ecosystems. However, the effects of introducing leguminous shrubs on soil microbial diversity and the relevant mechanisms are not clear. Here, we employed the high-throughput absolute quantification 16S rRNA sequencing method to analyze the diversity of soil bacteria in sand-fixing areas of mixed shrublands with three combinations of shrubs, i.e.,C. korshinskii×Corethrodendron scoparium(CaKCoS),C. korshinskii×Calligonum mongolicum(CaKCaM), andC. scoparium×C. mongolicum(CoSCaM), in the south of the Mu Us Sandy Land, China. This area suffered from moving dunes 20 years ago, but after introducing these shrubs to fix the dunes, the ecosystem was restored. Additionally, the effects of soil physicochemical properties on soil bacterial composition and diversity were analyzed with redundancy analysis (RDA) and structural equation modeling (SEM). It was found that the Shannon index of soil bacteria in CaKCoS was significantly higher than that in CaKCaM and CoSCaM, and the abundance of the dominant phyla, including Actinobacteria, Proteobacteria, Acidobacteria, Chloroflexi, Planctomycetes, Thaumarchaeota, Armatimonadetes, candidate_division_WPS-1, and Nitrospirae, increased significantly in CaKCoS and CaKCaM compared to that in CoSCaM. RDA showed that the majority of soil properties, such as total nitrogen (TN), available potassium (AK), N:P ratio, soil moisture (SM), and available phosphorus (AP), were important soil environmental factors affecting the abundance of the dominant phyla, and RDA1 and RDA2 accounted for 56.66% and 2.35% of the total variation, respectively. SEM showed that the soil bacterial α-diversity was positively affected by the soil organic carbon (SOC), N:P ratio, and total phosphorus (TP). Moreover, CaKCoS had higher SM, total carbon (TC), total potassium (TK), and AP than CaKCaM and CoSCaM. Collectively, these results highlight a conceptual framework in which the combination of leguminous shrubs can effectively drive soil bacterial diversity by improving soil physicochemical properties and maintaining ecosystem functioning during desertification reversal.Graphical AbstractSupplementary InformationThe online version contains supplementary material available at 10.1007/s00248-022-02151-0.