The Yellow River Basin (YRB) is an important ecological security barrier in China, playing an irreplaceable role in soil and water conservation, climate regulation, and biodiversity maintenance, and it is related to the stability and security of the ecosystem. Exploring the spatial correlation networks and factors influencing ecological security in the YRB can provide new ideas for cross-domain collaborative governance, promote efficient cooperation among regions, and optimize resource allocation. Using a quantitative approach to assess the YRB’s ecological security, we employed an adjusted gravity model, social network analysis, and quadratic assignment procedure analysis to understand the spatial connection dynamics. The results indicate the following: (1) Ecological security in the YRB continued to improve from 2005 to 2019, but the overall level was low. The degree of the dispersion of the ecological security status among cities constantly increased, and there were significant regional differences in the level of ecological security in the YRB. (2) From 2005 to 2019, the number and density of network connections among cities within the YRB increased significantly, and the ecological security links gradually strengthened. The Shandong Peninsula city cluster and the Hubao–Eyu City cluster are not only located at the core of the network but also play the role of “bridge intermediary”, exhibiting strong control. (3) Among all variables, economic development and geographic proximity increased significantly in terms of their correlation with the YRB’s ecological security. The study of spatial connectivity networks and their influencing factors in the YRB provides new ideas for inter-regional collaborative governance.