A friend gave me a cap with the inscription: The beatings will continue until crew morale improves"
My guess is it originated in the British Navy...circa 1700 or before. I wear the cap every time we leave the dock with a new crew member.
Beatings for even small infractions were common in 18th and 19th century military forces, including the US. I don’t know why they came about to the extent they did and when they abruptly stopped.