This is something I've noticed is uniquely culturally Indian, and transcends all religions. Which is beautiful.
I was once whacked in the head by a teacher for throwing a book onto the shelf, and rightly so.
And I highly doubt that, in general, 'whacking' children will make them grow up kinder more compassionate adults.
Considering the rationale offered by Hindus, I’d be inclined to believe it is a Hindu custom adopted by everyone else by virtue of relative numbers. Sort of like how Christmas is secular in the US, Diwali in India, and perhaps weaker something like Eid in Jordan.
So I agree, very little to do with religion today, but perhaps not so always. Something like Halloween perhaps.