The rapid economic development and accelerating urbanization have led to a significant mismatch between the urban bus network allocation and the population flow. Therefore, this paper investigates this challenge by exploring the intricate relationship between the population flow dynamics, traffic congestion conditions, and the efficient allocation of bus resources. In response, two key indexes were introduced based on spatial matching patterns to assess the urban bus network: the Population-Bus Match Index evaluates the matching degree between supply and demand, and the Population-Congestion Match Index evaluates the matching degree between utilization and saturation. Additionally, two distinct optimization strategies have been proposed to enhance the urban bus network. The first optimization strategy considers the bus network's current status, while the second aspires to an idealized scenario. Subsequently, the potential contributions of each bus station in reducing CO2 emission reduction after implementing the two optimization strategies are quantified. Utilizing a case study focused on Harbin, the proposed methods are validated. The findings unveil a substantial misalignment between supply and demand within the bus network during peak periods, with nearly half of the bus stations experiencing a disparity between utilization and saturation. Comparative experiments across different optimization strategies reveal that the second optimization strategy significantly outperforms the first, but the first optimization strategy has a higher degree of CO2 emission reduction contribution. The results of this study provide decision-makers with an environmentally oriented vantage point for the discerning selection of optimization strategies and leave valuable insights for urban areas confronting transportation challenges.