Maw I am aware of the difference, but sodapop's understanding of the phrase, and therefore how it should be spelled, is quite widely assumed and used now by many people. In other words, what words and phrases are understood to mean (and how they are spelled) changes with time. The fact that desert and desserts has two entirely different meanings is irrelevant. Many people think it is spelled 'desserts' and interprete it as I suggested. The result is the same, the meaning of the phrase, as a whole, though not each individual word remains the same.
'what happened to someone/a group serves you right, after what you did before''
There are other phrases and words where similar things have happened, inevitable I cannot think of any immediately, but I have noted them in my mind in the past.