Some medicines taste awful by themselves.
Medicines are compounds we have found to have an effect on our bodies. In many cases, they are small doses of poisons that plants, bacteria, or fungi have evolved to produce in order to kill whatever is eating them, by disrupting their internal chemistry.
We takes advantage of those millions of years of evolution by using small amounts of those poisons to change our body chemistry.
But we have also evolved for millions of years alongside these other organisms, and we have evolved sensors in our tongues and noses to detect when something is poisonous. So many of our medicines taste awful, usually by being quite bitter.
We mask those bitter tastes by adding sugar and acids to overwhelm the tongue, and by adding aromas and flavorings to overwhelm the nose. Even so, some flavored medicines still taste awful. And that is a good thing, because they are poisons if too much is eaten. We still want to be reminded that these things are dangerous if not used properly.