I was explaining this to my daughter in quite simplified terms the other day- we evolved to taste sugar and enjoy it because finding a sweet edible plant meant we had a source of energy to help us hunt that day. Pretty useful if you're a hunter-gatherer.