Climate change and human activities have caused various ecological risks to coastal urban agglomerations. Ecological security refers to the state of health of an ecosystem and its integrity. An objective and comprehensive evaluation of ecological security is significant for protecting the structure and function of coastal ecosystems. The driving force–pressure–state–impact–response (DPSIR) model was used to construct a dynamic simulation model of ecological security in the Xiamen–Zhangzhou–Quanzhou region (XZQR), located on the eastern coast of China. The ecological security level (ESL) characteristics of the spatial and temporal patterns were evaluated by calculating the ecological security index (ESI). Obstacle factors were analyzed as well. The results show the following: (1) From 2011 to 2021, the average ESI rose from 0.238 to 0.686 and went through a relatively insecure stage (2011–2015), a critical stage (2016–2019), and a relatively secure stage (2020–2021). (2) The ESI level in Quanzhou was higher in the early stage, and the level of ecological security in Zhangzhou showed a significant rising trend, increasing by 0.541. Its increase depended on increases in the impact layer. (3) The impact layer is the main obstacle layer affecting the ESL, and the main obstacles include CO2 emissions (0.117), annual rainfall (0.091), general public budget expenditures (0.082), GDP growth rates (0.082), and green coverage in built-up areas (0.075). Therefore, we recommend promoting the complementary advantages of the XZQR and implementing ecological restoration projects.