Why are we wired to like sweet taste so much?
"Taste" is what we sense in the mouth. "Flavor" includes both taste and the sensations we detect by our sense of smell--when you put food in your mouth, lots of smelly stuff, good or bad, finds its way from the back of your mouth up to your olfactory (smell-detection) system.
The sense of taste includes sweet, bitter, salty, sour, umami (savory), and probably others such as fat and calcium. These tastes serve important purposes. Umami detects the presence of protein, an essential part of the daily diet. Salty taste detects sodium and chloride, important electrolytes. Sour taste can alert us to spoilage, and bitterness is associated with many toxic substances in our environment. Sweetness (up until the last 100 years) has almost always meant sugar, a signal for foods that contain usable energy.
Whether you believe in evolution, creation, or some combination of the two, it's obvious that, for most of human existence, it would have been useful to associate pleasure and craving with sugar (and the calories that come with it). Only in the industrial age have we had so much access to sugar that sweetness from sugar represents a health problem.
The sweet taste receptors that detect sugars are rather unique, compared to other receptors. Receptors that detect hormones and neurotransmitters, for example, are exquisitely sensitive--they can respond to a millionth of a gram or less of the substance they are to detect. But a millionth of a gram of sugar would not provide enough energy for you to walk to the front door! So sweet taste receptors are, by comparison, very insensitive. They don't detect sweetness unless the stuff in your mouth is at least 1% sugar, and that's a low level of sweetness. Carbonated soft drinks and fruit juices are usually in the neighborhood of 10% sugar.
So the human body is hard-wired to enjoy sweetness, specifically sweetness corresponding to 5-10% sugar. It's easy to see why the combination of a sedentary lifestyle and easy access to sugar makes it easy (and even pleasant!) to consume far more calories than we need.