Positive relationships between tree species diversity and soil communities are reported in many studies. However, the effects of tree species richness and nitrogen (N)-fixing tree species on soil fauna communities are not yet fully understood. Here, we conducted a field experiment to investigate changes in soil nematode communities under a gradient of tree species richness (e.g., 1, 2, 4 and 6 tree species) with N-fixing tree species (absence or presence). We found that N-fixing tree species strongly affected soil nematode trophic groups, and significantly increased the abundance of omnivore-predators and structure index via promoting more trophic links and multi-trophic interactions, leading to a more stable and complex soil food web. In the presence of N-fixing tree species, tree species richness significantly increased the abundance and relative abundance of fungivores and the channel index, with the shift in soil energy channel through increased the C/N ratio of leaf litter. In contrast, tree species richness detrimentally affected the abundance of plant parasites due to the decline of leaf litter N content under the presence of N-fixing tree species. The results revealed that the bottom-up effects of N-fixing tree species on soil nematode community structure were crucial drivers in shaping nematode communities in subtropical plantations. Our study suggests that N-fixing tree species is more important than tree species richness to regulate soil nematode community structure and soil energy channel, and therefore, should be preferentially considered in multispecies forest plantations.