This study uses sustainability and stakeholder theories to examine how corporate digital transformation (DIT) impacts ESG (Environmental, Social, Governance) performance, focusing on listed Chinese manufacturing firms from 2015 to 2020. The analysis employs two-stage least squares model (2SLS) and propensity score matching-differences in differences (PSM-DID) technique to address endogeneity, and a series of robustness checks to validate the results. Findings reveal that DIT enhances ESG performance by fostering green innovation, encouraging risk-taking, and optimizing resource allocation. Economic policy uncertainty and executives' gender diversity impede these benefits, while party organization embeddedness shows no moderating effect. Additionally, the study identifies spatial spillover effects of DIT on ESG performance, with synergistic effects observed among companies within the same locality and industry. These insights offer profound implications for governmental efforts to improve the business environment and promote green development, ensuring the equitable distribution of "digital dividends” among stakeholders.