Pedagogical purposes
Quite simply, to teach them the principles of magic. If I had to guess, I would say that certain transformations are "easier" than others, and thus ideal for teaching basic magical principles. For example, turning vinegar to wine is simply the reverse of the natural process of wine spoilage, in which wine can turn into a kind of vinegar.
This is the same reason, for example, that McGonagall has students transform hedgehogs into pincushions.
“Maybe not, Thomas, but believe me, you need all the preparation you
can get! Miss Granger remains the only person in this class who has
managed to turn a hedgehog into a satisfactory pincushion. I might
remind you that your pincushion, Thomas, still curls up in fright if
anyone approaches it with a pin!”
—Harry Potter and the Goblet of Fire
There appears to be a sort of Law of Similarity at play, in which transforming one object into another that is close is relatively easy.
As to whether Flitwick would be worried about safety, I think not:
- The students are already drinking butterbeer, which is mildly alcoholic.
- They can probably procure mead from Hogsmeade or the kitchens easily enough.
- They do far more dangerous things on a regular basis, such as detention in the Forbidden Forest, zooming around on brooms at bone-breaking speeds, and dealing with lethal plants and animals. Compared to this, the risk of students getting drunk seems tame.
The real question is why transforming vinegar into wine is being taught in Charms class, rather than in Transfiguration.