Empirical research has revealed conflicting associations between dependent and independent variables, with few studies tackling the dynamics in developing economies. This study investigates the effects of carbon dioxide emissions, renewable energy consumption (REC), foreign direct investment (FDI), government green capital spending (GGCS), and economic growth (EG) in Morocco, employing the Keynesian framework of economic growth. An autoregressive distributed lag (ARDL) methodology was applied to assess both short- and long-term relationships among the model’s variables, using annual data from the World Development Indicators (WDI) database for the period 1993–2020. All ARDL variables were transformed into first differences to ensure stationarity. The bounds test confirmed a long-term equilibrium relationship between the dependent and independent variables. Diagnostic tests, including the White test, indicated no evidence of heteroscedasticity, and the Shapiro–Wilk test confirmed that residuals followed a normal distribution, validating model robustness. The model demonstrated overall stability across the study period with no structural breaks. The empirical findings suggest that both carbon dioxide emissions and renewable energy consumption exhibit positive trends, whereas GGCS demonstrates a significant short-run negative correlation with economic growth. However, the long-term coefficients were found to be statistically insignificant, suggesting that sustained policy effects may be attenuated by macroeconomic structural factors.