Locking people in a room also isn't pleasant, yet we allow it, because we think it has a deterring effect. Hitting people with sticks or tear gas, forcing there limbs together with steel also isn't very nice. Neither is forcing people in a plane and sending them off into dangerous environments just because they happen to be born there.
Locking criminals away to protect innocent people is different than caning and you know that.
And I'm pretty sure the type of person speaking out against outdated, abusive child rearing doesn't support the use of cudgels or tear gas in law enforcement or unsafe/cruel deportation.