The ameliorative effects of straw decomposition products on soil acidification have been extensively studied. However, the impact of chemically treated straw decomposition products on crop productivity and the underlying microbial mechanisms remain unclear. This study aimed to investigate the effects of two dosages of Ca(OH)2-treated straw decomposition products of peanuts on red soil acidity, fertility, and bacterial and fungal diversity through a pot experiment. The pot experiment included four treatments: chemical nitrogen, phosphorus, and potassium (NPK) fertilization alone (CK), NPK chemical fertilization combined with peanut straw decomposition products (PS), NPK chemical fertilization combined with 4% Ca(OH)2-treated peanut straw decomposition products (PS4Ca), and NPK chemical fertilization combined with 8% Ca(OH)2-treated straw decomposition products (PS8Ca). High-throughput sequencing was performed to investigate the effects of these treatments on soil microbial diversity. The treatments with PS, PS4Ca, and PS8Ca significantly increased soil pH, exchangeable base cations, and nutrient content, whereas they decreased the exchangeable acid, especially exchangeable aluminum. The peanut growth improved substantially with the application of straw decomposition products. Specifically, PS4Ca significantly increased the Shannon and Richness indices of fungi. The principal coordinate analysis showed that the soil microbial communities in the straw decomposition product treatments were significantly different from CK. Linear discriminant analysis effect size identified unique bacteria and fungi between treatments. The Mantel test indicated that exchangeable base cations and pH were significantly positively correlated with bacterial communities, whereas available potassium was positively correlated with fungal communities. The partial least squares path modeling revealed that the bacterial communities positively and directly affected all peanut agronomic traits. In contrast, the fungal communities had a negative and direct effect only on peanut 100-pod weight. Therefore, adding Ca(OH)2-treated straw decomposition products could effectively improve crop productivity by alleviating soil acidification, increasing soil nutrients, and subsequently changing microorganisms.