Cavemen did not have candy. Cavemen had fruit. Fruit is energy-dense, easy to harvest, and it keeps longer than meat--it's the perfect food for an omnivore, so we evolved to crave it.
And then we figured out how to make stuff that's even sweeter and more energy-dense than fruit, so it tastes even better and we eat loads of it even though we're not starving hunter-gatherers and don't the extra energy at all. But that didn't play into our evolutionary process.
Of course sweet isn't the only flavor we crave. I don't know exactly what combination of tastes makes meat appealing, but the fact that there's no single "meat" taste doesn't mean we didn't evolve to crave it. It just means that's the chemical pathway that our taste buds happened to follow.