The carbon sequestration capacity of vegetation is the key to the carbon cycle in terrestrial ecosystems. It is significant to analyze the spatiotemporal variation and influencing factors of vegetation carbon sequestration ability to improve territorial carbon sink and optimize its spatial pattern. However, there is a lack of understanding of the impact of environmental conditions and human activity on the vegetation’s carbon sequestration ability, especially in highly urbanized areas. For example, effective vegetation management methods can enhance vegetation Gross Primary Productivity, while emissions of air pollutants like O3, CO, NO2, and PM2.5 can suppress it. This paper mainly explores the factors influencing vegetation carbon sequestration capacity across different regions of Beijing. Based on remote sensing data and site observation data, this paper analyzed the spatiotemporal variation trend of Annual Gross Primary Production (AGPP) and the influence of environmental factors and human activity factors on GPP in Beijing from 2000 to 2020 by using the Theil−Sen’s slope estimator, Mann−Kendall trend test, and comparing Geographically Weighted Regression method (GWR) and Geographically and Temporally Weighted Regression method (GTWR). GWR is a localized multiple regression technique used to estimate variable relationships that vary spatially. GTWR extends GWR by adding temporal analysis, enabling a comprehensive examination of spatiotemporal data variations. Besides, we used land use cover data to discuss the influence of land use cover change on AGPP. The results showed that the spatial distribution pattern of GPP in Beijing was higher in the northwest and lower in the southeast, and it showed an overall upward trend from 2000 to 2020, with an average annual growth rate of 14.39 g C·m−2·a−1. From 2000 to 2020, excluding the core urban areas, the GPP of 95.8% of Beijing increased, and 10.6% of Beijing showed a trend of significant increase, concentrated in Mentougou, Changping, and Miyun. GPP decreased in 4.1% of the regions in Beijing and decreased significantly in 1.4% of the areas within the sixth ring. The areas where AGPP significantly decreased were concentrated in those where land use types were converted to Residential land (impervious land), while AGPP showed an upward trend in other areas. CO and NO2 are the main driving forces of GPP change in Beijing. O3 and land surface temperature (LST) also exert certain influences, while the impact of precipitation (PRE) is relatively minor. O3 and CO have a positive impact on AGPP as a whole, while LST and NO2 generally exhibit negative impacts. PRE has a positive impact in the central area of Beijing, while it has a negative impact in the peripheral areas. This study further discusses opinions on future urbanization and environmental management policies in Beijing, which will promote the carbon peak and carbon neutrality process of ecological space management in Beijing. Besides, this study was conducted at the urban scale rather than at ecological sites, encompassing a variety of factors that influence vegetation AGPP. Consequently, the results also offer fresh insights into the intricate nexus between human activities, pollutants, and the GPP of vegetation.