If teacher punishing student is also supposed bad karma? Either school teacher or Buddhist teacher in monastery, if they would punish their students is also supposed bad karma even if it cause of bad behavior of students?
Buddha did not do any violence. The suttas say:


  it is true, Kesi, that it's not proper for a Tathagata to take life. But if a tamable person doesn't submit either to a mild training or to a harsh training or to a mild &amp; harsh training, then the Tathagata doesn't regard him as being worth speaking to or admonishing.