Why is it still legal to physically punish kids in school?

Is it rare for US teachers to spank unruly children at school?
https://www.bbc.com/news/world-us-canada-56986827
Why is it still legal to physically punish kids in school?
https://www.refinery29.com/en-us/2021/05/10459991/melissa-carter-paddling-spanking-children- us-laws