Speaking as a teacher who has made use of corporal punishment over the years, while your suggestions as to reasons are certainly possible, there are other less troublesome possibilities as well. There were, and are, teachers who take delight in humiliating students, who might enjoy getting a rise out of a class, or who might take pleasure in administering physical punishment. But they are not that common.
Another possibility for what you saw is as a warning – a reminder to the student in question, and perhaps to the class of what can happen and what might happen if their behavious doesn’t improve right now. I wouldn’t approve of such a practice myself – I think it diminishes the threat of corporal punishment if it’s used in that way, but I can certainly see it happening.