Microbial activity plays a crucial role in upholding the functional stability of vegetation–soil ecosystems. Nevertheless, there exists a paucity of studies concerning the impact of sand-fixing vegetation (Haloxylon ammodendron) on the structure and functional attributes of soil microbial communities. We employed Illumina high-throughput sequencing and PICRUSt2 functional prediction technology to investigate the characteristics of soil bacterial community structure, diversity, and metabolic functions in an artificial H. ammodendron forest, and RDA analysis and the Mantel test were used to reveal the main environmental factors affecting the structure and ecological functions of soil bacterial communities. The findings revealed a significant increase in the principal nutrient contents (organic matter, total nitrogen, total phosphorus) in the H. ammodendron forest soil compared to the mobile dune soil, while a reduction of 17.17% in the surface soil water content was observed. The H. ammodendron forest exhibited a significant enhancement in the diversity and richness index of soil bacteria. Specifically, Actinobacteria (24.94% ± 11.85%), Proteobacteria (29.99% ± 11.56%), and Chloroflexi (11.14% ± 4.55%) emerged as the dominant bacterial phyla, with Actinobacteria displaying significantly higher abundance compared to the mobile dune soil. PICRUSt2 analyses revealed that the predominant secondary metabolic functions of soil bacteria were carbohydrate metabolism, amino acid metabolism, and the metabolism of cofactors and vitamins. Additionally, the tertiary metabolic pathways exhibited greater activity in relation to enzyme function, nucleotide metabolism, energy metabolism, and antibiotics. The RDA results demonstrated that SOM, AK, and pH collectively accounted for 82.4% of the cumulative contribution, significantly influencing the bacterial community. Moreover, the Mantel test revealed that the metabolic function of soil bacteria primarily relied on five environmental factors, namely SOM, TN, AK, pH, and EC. This study significantly advances our understanding of the structural and functional changes in soil bacterial communities during the reclamation of sandy land through the establishment of artificial H. ammodendron forests.