It is critical for promoting high-quality economic development to improve green total factor productivity (GTFP). The “structural dividend” released by the optimization of economic structure and the “reform dividend” brought by market-oriented reform are the two ways to improve GTFP. This paper empirically examines the impact of economic structural changes and marketization progress on GTFP with the spatial dynamic panel model based on the provincial data from 2001 to 2019 in China. The findings are as follows. (1) GTFP is characterized by significant spatial clustering and spatial positive correlation in China. (2) The optimization of economic structure and the improvement of marketization both have significant positive contributions to the improvement of GTFP. (3) The results of effect decomposition show that the optimization of economic structure has a long-term effect on the increase of local GTFP, but only a short-term effect on the surrounding areas. However, the improvement of marketization has a stable short-term and long-term impact on the improvement of local GTFP, while the impact on the surrounding areas is only reflected in the long-term. The results of heterogeneity analysis indicate that the impact of economic structure optimization and market-oriented reform on GTFP is different in different periods and regions, and the corresponding effect decomposition results are also different. Therefore, this paper suggests that it is necessary to optimize the economic structure further and promote market-oriented reforms to release the structural dividends and reform dividends to achieve GTFP growth.