Hospitals are an important piece of infrastructure for global emergency management, and their evacuation efficiency is crucial during large-scale disasters or public health crises. Traditional evacuation methods mainly focus on proximity and often overlook dynamic pedestrian density and channel capacity, leading to local congestion and increased risk. This study introduces a dynamic optimization evacuation path planning framework based on flow space theory to address the overall inefficiency in hospital evacuation. We model the hospital space as a dynamic network flow, analyze evacuation time through walking and queuing time, and apply a density–velocity correction model to adjust path allocation in real time. Using the MassMotion 11.0 platform to compare the evacuation of simulated hospital models before and after path optimization, the results showed that the average evacuation time was reduced by 10.58%, the waiting time in high-density areas was shortened, and the overall efficiency was improved. Empirical exercises show that path optimization can shorten evacuation time, demonstrating that spatial optimization strategies enhance hospital resilience. These results confirm the practical value of the flow space theory in emergency management for dealing with disasters. The flow space theory enriches the theoretical system of evacuation planning and contributes to a more in-depth study of people’s evacuation behaviors and the optimization of evacuation strategies.