I give the bad tasting medicine to kids that drive me nuts
Don't you think its petty to do that to children?
I want the children to stop for their despicable behavior
Children can be annoying but it is not right to do bad things to them. They are just learning and don't know any better, you do.
It's fine. I did it because they need to be punished.
Punishment is meant to deter behavior. However if you're punishing them for a behavior they're doing and they're not aware of it, then they won't know what behavior to correct. What you're doing is just being petty and taking out vengeance.