In response to the insufficient research on the collaborative mechanism between environmental regulation and enterprise digital transformation, this article proposes three hypotheses based on Porter’s theory of competitive advantage: direct driving of carbon trading policies, alleviation of financing constraints, and green technology innovation; Then, using panel data from Chinese A-share listed companies from 2010 to 2021, and combining dual machine learning and double difference method, a quasi-experimental study was conducted to systematically identify the net effect of policies. The empirical verification results show that the carbon trading pilot policy significantly promotes the digital transformation of enterprises, and the core coefficient remains stable under multiple algorithms and passes the 1% significance test. This indicates that the policy can empower digital transformation through two paths: reducing debt financing costs and enhancing green innovation output, thereby providing empirical evidence for the coordinated promotion of the “dual carbon” strategy and the development of the digital economy.