No one “deserves” pain.
Sometimes you have to apply harm to stop greater harm, but the concept of “deserving” harm is disgusting.
If you have to use violence on someone, to stop them from causing greater harm, they deserved it.
If I have to use violence on someone, I am sad that the situation is such that I have to do so, and I wish it weren’t so.
This doesn’t mean they don’t deserve it. It just means you are sad it had to come to this. The fact that you had to resort to violence, due to how awful they are, means they deserved it. Had they not deserved it, you wouldn’t have great cause to be violent. Unless you are becoming violent towards people that would respond to lesser input, they deserved it.