Which is correct when referring to the punishment gotten by an evil-doer: just deserts or just desserts?
"Just deserts" refer to the consequences that are deserved. However, "desserts" refer to a part of a meal. Changing the spelling of the word in this case changes the meaning entirely, unlike the examples above.
Therefore, "just deserts" is deserved consequences and "just desserts"(there is no such phrase) refers to a deserved refreshment after a meal.
On my NOAD, the third meaning of "desert" is this one:
A person's worthiness or entitlement to reward or punishment: "the penal system fails to punish offenders in accordance with their deserts."
Then it gives one entry in the Phraseology section:
get (or receive) one's just deserts:
receive the appropriate reward or (more usually) punishment for one's actions: "those who caused great torment to others rarely got their just deserts."
Finally, the etymology:
Middle English: via Old French from deservir ‘serve well’ (-> deserve ).
There is also an entry on the OALD.
The problem here is that in the phrase "just deserts", the word is pronounced identically to "desserts". The word "deserts" isn't actually all that commonly used outside of this idiom, so most people think that spelling refers only to a geographic zone receiving minimal rainfall (e.g. Sahara desert). "Just Desserts" is simply a spelling error, unless it is being used as the name of a bistro specializing in after-dinner snacks.
The correct phrase is just deserts.
According to Wiktionary,
just deserts (plural only)
(idiomatic) A punishment or reward that is considered to be what the recipient deserved.
It may appear that they're getting ahead by cheating, but they'll get their just deserts in the end.
Deserts here is the plural of desert, meaning "that which one deserves". It is rarely used with this meaning outside this phrase.
The spelling just desserts is commonly seen but is incorrect. The misspelling is occasionally used deliberately as a play on words in the names of restaurants etc.