It's a little more complicated than that. The Greeks claimed at the time to be fighting for a common love for freedom and the rule of law, as opposed to absolutism and tyranny, which they attributed to Persia. Not for "democracy" per se, but at least against tyranny (it became customary later on in Greece to distinguish at least three classes of regimes, tyranny, oligarchy and democracy, the latter two sponsored respectively by Sparta and Athens). The Spartans were particularly adamant in their utmost respect for the laws and for equality. Of course, nowadays people point out petty facts like the fact that much of "Spartan law" was unwritten custom which gave the ephors enormous powers of interpretation, or the fact that their "equality" was the equality of a few thousands full-fledged citizens oppressing tens of thousands of underlings in various classes. Still, that is what they claimed and I am convinced they were sincere in much of that propaganda.