Why is the taste of magic mouthwash so bad?

Lidocaine . Generally a "magic mouth rinse" contains a numbing agent called viscous lidocaine. This is most likely the agent that tastes bad.
It's the drugs... There are literally hundreds (if not thousands) of ways to order 'magic mouthwash'. Off the top of my head, i've seen it contain benadryl, (diphenhydramine) maalox, lidocaine, tetracycline (antibiotic), Nystatin (antifungal), as well as other medications. Needless to say, most of these don't taste very good. Magic mouthwash is somewhat of a 'kitchen sink' approach. It contains a little of everything.