The teacher was unprofessional for sure, but I can just imagine the type of child that would draw that type of comment.
You wouldn't say it to the nice kid who whispered for someone to pass him a pencil would you?
To be blunt, in that lesson at least, he probably was a waste of space.
Has it shocked him to think that people see him like that? Maybe that's a wake up call then.
And to think that, if he doesn't like being seen that way, all he has to do is listen in class and do his work!
And regarding his hurt feelings : don't be fooled. He's said worse to people, and heard worse too. He just likes you focusing on that, and maybe getting the teacher in trouble.
Honestly, the best, most character-building thing you could do is tell him to sort himself out so nobody ever associates that phrase with him again.