This study explored the external influences of the public sector on the density of environmental nonprofits by examining the government failure and interdependence theories. We used county-level data from the U.S. and spatial models to identify four key drivers that impact the establishment of environmental nonprofits: population heterogeneity, fiscal centralization, government grants, and government expenses. Using a spatial autoregressive model with spatial-autoregressive disturbances, we analyzed the effects of external factors on nonprofit organizations within a local government’s jurisdiction and their density in surrounding areas. Our findings revealed that educational and racial heterogeneity were negatively associated with nonprofit density, supporting the cohesion theory rather than the government failure theory. Fiscal centralization demonstrated a negative correlation with nonprofit density, while government grants and expenses showed positive associations. The study found significant spillover effects: changes in one county’s characteristics influenced nonprofit density in neighboring areas. These findings suggest that the relationship between nonprofits and government can be both complementary and substitutive, depending on the specific characteristics of local jurisdictions. Our results underscored the significance of analyzing spatial patterns and interdependence when studying nonprofits, suggesting that traditional analytical approaches may yield incomplete or biased conclusions. The study contributes to the literature by providing a more nuanced understanding of how environmental nonprofits interact with local governments and each other across jurisdictional boundaries, offering new insights into the complex dynamics of public-nonprofit relationships in environmental sustainability efforts.