The global COVID-19 pandemic has severely impacted human health and socioeconomic development, posing an enormous public health challenge. Extensive research has been conducted into the relationship between environmental factors and the transmission of COVID-19. However, numerous factors influence the development of pandemic outbreaks, and the presence of confounding effects on the mechanism of action complicates the assessment of the role of environmental factors in the spread of COVID-19. Direct estimation of the role of environmental factors without removing the confounding effects will be biased. To overcome this critical problem, we developed a Double Machine Learning (DML) causal model to estimate the debiased causal effects of the influencing factors in the COVID-19 outbreaks in Chinese cities. Comparative experiments revealed that the traditional multiple linear regression model overestimated the impact of environmental factors. Environmental factors are not the dominant cause of widespread outbreaks in China in 2022. In addition, by further analyzing the causal effects of environmental factors, it was verified that there is significant heterogeneity in the role of environmental factors. The causal effect of environmental factors on COVID-19 changes with the regional environment. It is therefore recommended that when exploring the mechanisms by which environmental factors influence the spread of epidemics, confounding factors must be handled carefully in order to obtain clean quantitative results. This study offers a more precise representation of the impact of environmental factors on the spread of the COVID-19 pandemic, as well as a framework for more accurately quantifying the factors influencing the outbreak.