Soil fungi play vital roles in natural ecosystems, however, their community distribution patterns along different environmental gradients and ecological assembly processes remain unclear. In this study, Illumina MiSeq sequencing was used to investigate the soil fungal community structures of five different forest types along an elevational gradient, and a framework based on a null model was adopted to quantify the relative contribution of deterministic and stochastic ecological assembly processes. The results showed that the majority of soil fungal OTUs were derived from Zygomycota, Basidiomycota, and Ascomycota. Soil fungal community structure differed significantly among the five sites ( P < 0.01), and the fungal α-diversity decreased as elevation increased ( P < 0.01). The null model showed that the relative contribution of stochastic processes (37.78–73.33%) was higher than that of deterministic processes (26.67–62.22%) within the same forest type, while that of deterministic processes (35.00–93.00%) was higher than stochastic processes (7.00–65.00%) between forest types. These results suggest that forest soil fungal diversity decreased significantly with increasing elevation, and that deterministic processes may be key factors influencing soil fungal community assemblies among forest types. The results of this study provide new insight into soil fungal distribution patterns and community assembly processes in natural forest ecosystems.