It wasn’t just the 300 Spartans who made the final stand against the Persians. Larger groups of Thespians and Thebans fought to the death with the Spartans. The total is thought to have been 1400 - 1500 Greeks making the final stand; still an exceptional episode in history.
In addition the Naval battle fought by the Athenians at Salamis which occurred shortly thereafter (~a month) was at least as important in stopping the Persians as it decimated their ability to protect their flank and maintain a logistics supply to the force since it opened the strait (Hellsponte) crossing to attack.
you are correct. The Spartans, thought, had a better press agent.
Don’t forget 600 Spartan helots, so it was closer to 2000. Some of the Thebans surrendered.