To achieve China’s “dual carbon” and common prosperity goals, corporate green governance is crucial. A key tool for promoting green growth is environmental legislation, particularly market-based regulation. With China’s carbon emission trading as a natural experiment, we adopt the DID method to quantitatively compare the gap between ESG performance of pilot and non-pilot carbon trading enterprises before and after policy implementation, thereby examining the impact, mechanism and optimization conditions of market-based environmental policy on corporate green governance based on panel data of China’s A-share listed companies from 2007 to 2019. In addition, PSM-DID and other methods are employed for preventing estimation bias caused by sample self-selection bias. It is found that: (1) the green governance level of pilot firms can be considerably improved by a carbon emission trading scheme (ETS); (2) the ETS primarily encourages enterprises to uphold their ESG obligations through increasing regulatory pressure from the government and corporate involvement in clean innovation; (3) enhancing regional marketization can strengthen the impact of carbon trading policy, and enterprises that are large and non-state-owned exhibit better performance with regard to green governance as a result of carbon trading policy. This paper provides practical experience for promoting corporate green governance to achieve the “dual carbon” goal based on a market mechanism from a micro perspective.