I try not to do it.
Why do teachers do it, probably despiration. If you have stood in front of a class for days or week, tried all the things you can think off an nothing has worked, then you may be desparate enough to try it.
Doesn't make it right, but teachers are human.
There are also times when 5 kids messing round can make it to dangerous for the erst of the class to do an activity....I have cancelled practicals for this reason. Not often, but I have done it because he safety of the kids is my prime concern. More often I stop specific students, but soetimes if there are lots of them mucking about, you simply don't have the time to stop each mirscreant individually.
And I'll bet that if I do this, some parent, somehwere will think that I am 'picking on' their kid. That theor kid has got a ban name, and I'm over reacting.
There are times when nothing we do is right. There you go.