I've never quite understood the theory behind this saying. What exactly is so bad about doing that, yet the context in which the saying is used is always of someone taking advantage.
It took me a long time before I understood this too...... As emeritus says, once you have eaten your cake, you don't have it any more. It's written the wrong way round which is really confusing.
"You can't have your cake and eat it too -- One can't use something up and still have it to enjoy. This proverb was recorded in the book of proverbs by John Heywood in 1546, and is first attested in the United States in the 1742 'Colonial Records of Georgia' in 'Original Papers, 1735-1752.' The adage is found in varying forms: You can't eat your cake and have it too. You can't have everything and eat it too; Eat your cake and have the crumbs in bed with you, etc. ..." From the "Random House Dictionary of Popular Proverbs and Sayings" by Gregory Y. Titelman.
" You Cant Have Your Kate and Edith Too"
~Statler Brothers
Hope this solves all of your problems. Just download the song and you will underatand the idea. The origins come from here, but the translation was lost somewhere along the way. There is no "have your cake and eat it too". Somebody was drunk or high when they came upon that and it has just progressed into an American saying.