The molecular basis for taste is relatively straightforward. On your tongue, you have numerous taste buds that harbor cells with little proteins hanging out on the top. These proteins have the capacity to bind a number molecules on your tongue, and thereby transmit information regarding nutritional content.
One of these proteins is TAS1R2, which, along with the protein TAS1R3, binds sweet tasting molecules. This sweet receptor is what allows you to savor the delicious sucrose (table sugar), fructose (fruit sugar) and even artificial sweeteners such as saccharin and aspartame. If you love cake, ice cream, and cookies, be grateful that you have a functional sweet receptor!
Not all animals are fortunate enough to enjoy these treats, however, and evolution is likely to be blamed. Many species are particularly adapted to eating foods that are nearly devoid of sugars, and therefore are not expected to benefit from maintenance of the gene encoding TAS1R2. Indeed, scientists  have found that a number of carnivorous mammals, including cats, hyenas, seals, the banded linsang, fossa and Asian small-clawed otter have a pseudogenized (nonfunctional) version of the TAS1R2 gene.
This helps explain why cats behaviorally seem uninterested in sugar. The scientists also confirmed that the Asian small-clawed otter also is not drawn to sweets, consistent with its TAS1R2 pseudogene. By contrast, they found that the spectacled bear, which has an intact TAS1R2 gene and is a known devourer of sweet things like fruits and honey, prefers sugary solutions over water.
These data suggest that the ancestral carnivores did eat sweets on occasion, but certain species avoided sugary foods for so long that sweet receptors were no longer necessary. Eventually mutations rendered the TAS1R2 gene nonfunctional in different carnivore lineages, rendering these species impervious to the effects of sweets.
Questions for Creationists
Why did God create some carnivores with a nonfunctional version of the sweet taste receptor gene? Would it not have made more sense for Him to create them without the gene altogether? Is it just a coincidence that He also created other animals with specialized feeding strategies, such as giant pandas and whales, to lack certain taste receptors?
1. Jiang, P., Josue, J., Li, X., Glaser, D., Li, W., Brand, J. G., … & Beauchamp, G. K. (2012). Major taste loss in carnivorous mammals. Proceedings of the National Academy of Sciences, 109(13), 4956-4961.