This is a pun on the word "agreed". Agreed has the word greed in it. Greed is a strong desire for something, like money or food. This joke is about a guy who is greedy and wants to eat lots of cake.
' ' I ' d like to eat seventeen cakes , ' ' Tom agreed .