Soil microbes play vital roles in mediating the functions and services of terrestrial ecosystems in the context of ongoing climate change and human disturbance. There are complex interactions between soil microbial taxa. However, research on the drivers of soil microbial network complexity and stability based on microbial taxa interactions is still in its infancy. We examined network structure and the complexity and stability of soil microbial communities across a large-scale environmental gradient in semi-arid grasslands of northern China by combining network theory and high-throughput sequencing. We found that aridity was the strongest driver of soil microbial network structure. Increasing aridity directly reduced the complexity and stability of soil microbial networks by decreasing the ratio of microbial taxa that participated in network construction and the ratio of potential positive and negative interactions of networks. Soil heterogeneity enhanced microbial network complexity and stability by potentially promoting diverse host plants and mediating uneven distribution of soil resources. These findings suggest that aridity and decreasing soil heterogeneity may have detrimental influences on soil microbial functions and the associated plant performance. This study provides new insights into the controls of climatic and/or edaphic variables in regulating soil microbial networks and highlights the importance of environmental heterogeneity in community assembly mechanisms of soil microbes.