The underlying motivation behind corporate philanthropy (CP) is subject to multiple interpretations. For emerging markets, traditional interpretations based on a perspective of interest exchange often fall short. The institutional environment in China is characterized by uncertainty, particularly in the field of environmental protection, where the government's attention, a scarce institutional resource, can influence the behaviors of heavily polluting companies. The government's environmental attention (GEA) may be subject to campaign-style investment, which provides an opportunity for research. This study attempts to use institutional theory to construct a difference-in-differences model using the Central Inspection of Environmental Protection as an exogenous shock. It examines the causal impact of GEA on CP, observing that GEA has a positive effect on CP, especially for large companies, companies in less competitive industries, companies located in high-pollution areas, and companies with high environmental expenditure. The results indicate that campaign-style institutional changes provide a non-transactional political motivation for CP. In addition, we discuss the mechanism, which is the expectation change. Campaign-style institutional changes work by altering corporations' expectations of the future institutional environment. We verify this mechanism from two perspectives, namely, the intensity of changes caused by uncertainty and corporate sensitivity to changes. Our results remain robust when subject to several tests based on different identification hypotheses and alternative measures. Unlike the existing literature on the political connections driving CP in China, this study, based on the institutional theory framework, reveals that campaign-style institutional changes constitute a non-transactional, unidirectional political motivation, which is a significant driving factor for CP in a Chinese context. This study evaluates the importance of GEA and reveals the non-transactional political motivations from the institutional theory perspective. This not only enriches existing discussions on the political motivations of CP but also broadens our understanding of the relationship between institutional uncertainty and CP in emerging markets.