Based on the panel data of 283 prefecture-level cities in China from 2010 to 2021, this paper takes the pilot policy of “Broadband China” as a natural experiment to evaluate the impact of digital infrastructure construction on urban ecological welfare performance and its mechanism by using a progressive difference–difference model. The results show that China’s digital infrastructure construction will significantly reduce the performance of urban ecological welfare. Through the analysis of input and output, it is found that the construction of digital infrastructure can significantly reduce resource consumption and increase welfare output, especially economic welfare, but at the level of environmental pollution, it will significantly increase the discharge of industrial wastewater, which may be the main reason for the negative effect of digital infrastructure construction. Through the group analysis, it is found that the overall negative impact of digital infrastructure construction on ecological welfare performance may be caused by the ecologically fragile western region and the unreasonable industrial structure. Through the adjustment model, it is found that innovation investment can positively regulate the negative impact of digital infrastructure on ecological welfare performance. The grey model (GM) is further used to forecast the data for 2022–2025, and it is found that while the negative impact of digital infrastructure is decreasing, it is still significant. This study provides empirical evidence for accurately understanding the effect and mechanism of digital infrastructure construction on ecological welfare performance.