Davidia involucrata has an ancient origin, representing a remnant from the paleotropical flora that thrived during the Tertiary period. Altitudinal gradient acts as a natural testing ground for studying climate change, and research on the distribution patterns of microorganisms along altitudinal gradients is crucial in understanding the adaptability of D. involucrata to climate change. In our study, we examined sample sites ranging from 1600 to 2200 m in elevation, which are part of the primary habitat zone for Davidia involucrata within the Xuebaoding National Nature Reserve. In 2021, field surveys were conducted across four altitudinal gradients (1600 m, 1800 m, 2000 m and 2200 m) of the D. involucrata distribution in the nature reserve. The sampling plots were set in each altitudinal gradient, and three representative and healthy mature trees were selected as sample trees for each plot. Rhizosphere soils were used to test the soil stoichiometry characteristics and root zone microbial communities. Our findings indicated pronounced differences in soil total carbon (TC) and total phosphorus (TP) content and C:P and N:P ratios between the four altitude sites (p < 0.05). Analysis of the bacterial communities revealed higher richness (PD and Chao1 indexes) at ASL2000 and ASL2200 (high altitude) compared to ASL1600 and ASL2000 (low altitude) (p < 0.05). Non-metric multidimensional scaling analysis demonstrated a distinct clustering of bacterial communities between the high and low altitudes (p < 0.01). At the phylum level, Proteobacteria and Acidobacteria were predominant at high altitudes, while Actinobacteria and Chloroflexi dominated at low altitudes. The core microbiome, shared among all altitudes, comprised 377 genes. The analysis of differential abundance revealed notable disparities in the prevalence of certain bacterial genera with altitude, with Arthrobacter and Acidothermus experiencing the most pronounced shifts (p < 0.05). This confirmed that environmental factors significantly influenced bacterial community structure and abundance. Spearman’s rank correlations revealed that both Chao1 and PD indices were positively correlated with elevation, TC, and TN, with Chao1 showing stronger relationships. Both indices were negatively correlated with MAT, while only Chao1 exhibited a significant negative correlation with pH. Linear regression analysis further confirmed the significant associations between Chao1 index and elevation, TN, MAT, and pH. Furthermore, redundancy analysis demonstrated that altitude (ASL) and TN were the primary factors shaping soil bacterial community composition, explaining 21.32% and 30.70% of the variance, respectively. Altitude significantly influenced microbial community structure (p = 0.003). Distinct microbial taxa showed specific associations with environmental gradients, suggesting niche specialization in response to soil conditions. These findings suggest that altitude influences soil nutrient characteristics and microbial community composition in the D. involucrata habitat, offering insights into the ecological factors affecting this endangered species.