Straw return has been found to benefit soil fertility and crop yield, however, by which it affects microbial communities to mediate soil factors driving crop yields under maize continuous cropping systems in dryland areas is still unclear. To fill this gap, a 6-year field experiment was established with five straw return amounts (T0, T1, T2, T3, and T4, representing 0, 3,000, 6,000, 9,000, and 12,000kgha-1 of straw, respectively), and investigated the effects of on soil properties, enzymes, bacterial community composition and diversity, and crop yields. Our analysis showed that soil organic carbon (SOC), total nitrogen (TN), and total phosphorus (TP) contents significantly increased by 1-8%, 5-25%, and 2-9% under straw return treatments, respectively, compared to the T0, and soil catalase, urease, and alkaline phosphatase activities increased by at least 34.00%. Additionally, crop yield significantly increased by 4.23-12.00% under T1-T4 treatments, and showed highly significant relationships with SOC, TN, and TP. Importantly, we found straw return significantly altered the community of bacteria involved in the carbon and nitrogen cycle, and their abundance of strong responses depending on the amounts of straw return. For example, straw input increased the abundance of Proteobacteria (+2.64–5.57%), Acidobacteria (+3.82–13.83%), and Bacteroidetes (+15.37–30.49%). Similarly, the amount of straw application increased the bacterial diversity indexes (Shannon, 2.65–10.93%; Chao1, 13.47–18.50%), and had significant positive correlations with SOC, TN, and TP contents. Structural equation models (SEM) revealed that straw return management practice had positive and indirect effects on crop yields by influencing soil properties or the bacteria community. In conclusion, our findings revealed common associations and variations of bacterial community diversity with soil factors and crop yields at different straw return rates, and these findings provide insights and options for the development of better straw return strategies and sustainable agriculture in semi-arid regions.