This phrase is easier to understand if it is read as "You can't eat your cake, and have it too". Obviously once you've eaten your cake, you won't have it any more. Used for expressing the impossibility of having something both ways, if those two ways conflict.
He works so hard to pay for that fancy house of his that he never has any time to stay home and enjoy it.
Yeah, you can't have your cake and eat it too.