Our bodies are full of feedback systems that only work in our natural (i.e. pre-civilization, pre-agriculture, hunter-gatherer, nasty, brutish, short) environment. It should be no surprise that our food cravings are among them.
There are other fun examples. One is that our breathing reflex is based on CO2 concentration being too high rather than O2 concentration being too low, even though O2 concentration is more important! Breathe into a closed system with a CO2 scrubber in it and you'll quickly get loopy and then pass out from lack of oxygen (and then die, if nobody disconnects you) all the while feeling fine. Another is that the iris of the eye responds to visible light but protects against more. Looking at the Sun is normally OK (uncomfortable, but tolerable) because the feedback is set up properly, but during the totality of a solar eclipse (which of course occurred back then, but not often enough to matter, apparently) your iris will crank open and let in tons of UV from the Sun's still-visible corona, frying your retina if you look at it.
It makes a great deal of sense that we'd evolve strong cravings for things which are good for us in small quantities but bad for us in large quantities when those things were scarce in the distant past, and death came early by other means for other people, well before a bad long-term diet could kill. That doesn't mean this must be what happened, but given how much humans love sugar, and how rare concentrated sugar would have been for our ancestors, it's no surprise if sugar turns out to be bad for us when consumed in the quantities we really want.