Thermopylae was a failure. No really, it was an unmitigated disaster for the Greek defenders, with the only real questions being about what caused this (Leonidas’ generalship, failure of intelligence, sluggishness, indecisiveness, or infighting in the high command such that it existed). Just for a reference point, there were 300 full-blooded Spartans, 298 of whom lost their lives at Thermopylae, while a bit over 50 years later, 175 were captured at Sphacteria and this was enough to precipitate a truce in the Peloponnesian War. 300 was a huge number for Spartans.
Of course the problem with trying to figure out the series of events and why the 300 Spartans and volunteers from other states stayed behind and died is that the truth of the catastrophe is concealed by later propaganda which hails it as a noble sacrifice that helped saved Greece. The saviours who stayed for a suicide mission to hold off the horde as long as they could to allow Athens to evacuate.
The greatest problem with this chain of events is that the force sacrificed thousands of lives for three days, certainly not enough time to evacuate Athens in and of itself. Further, most of the army retreated in advance of the last day, so it seems possible that Leonidas and the volunteers were simply acting as a rear guard action and planned to withdraw themselves; then Leonidas died. Leonidas fell before the flanking force actually cut off the Greeks, but the tradition has a fierce fight over Leonidas’ corpse, and then before the Greeks could possibly disengage or withdraw, the trap was sprung.
Surely the Greeks fought nobly and fiercely, but they died. The survivors and the rest of the coalition remained quite pessimistic after this setback and did so until Salamis or well thereafter, but one effort to encourage them was to spin this disaster as a heroic sacrifice.
As popular media confirms to this day, the story has survived and flourished as a heroic stand of liberty and freedom against oppression, but one must not forget that the overarching message is actually one of complete failure.