Understanding how landscape pattern changes impact forest biodiversity conservation and ecosystem management is crucial. This study evaluated the biodiversity maintenance capacity (BMC) of forest landscapes in Beijing, China from 2005 to 2020 based on habitat quality and carbon sink. For this, the moving window method was employed to compute landscape indices that depict variations in landscape patterns, including intermixing, connectivity, diversity, and compactness. Lastly, the relationship between landscape pattern changes and the BMC of forest landscapes was investigated using a combination of spatial correlation analysis and geographic weighted regression measurement models. The results showed the following. (1) The average BMC increased from 0.798 to 0.822. Spatially, 84.14% of the areas experienced an improvement, mainly in the mountainous region. In contrast, a decrease was observed in 4.03% of the areas, primarily concentrated in the transition zone between mountains and suburban plain. (2) The landscape pattern changed dramatically from 2005 to 2020. Landscape intermixing and compactness decreased slightly by 11.45% and 7.82%, while landscape connectivity and diversity increased significantly by 64.28% and 55.44%, respectively. (3) The BMC’s global Moran’s I values in 2005 and 2020 were 0.711 and 0.782, respectively, signifying a spatial bipolar agglomeration pattern. (4) Among the four selected landscape indices, the compactness was found to be the most critical factor. It attained a positive contribution to forests with high BMC, but had a negative impact on forests with low BMC. The results could provide a reference for planners coordinating forest management and biodiversity conservation.