Professor using student paper as an example of what not to do in class?
This sort of behavior by a professor is poor pedagogical technique and, in many cultures, poor etiquette.  It is not misconduct and it is not rule breaking.  If you are a student and a professor acts this way, you can criticise the behavior in any anonymous teaching evaluations.  Otherwise, ignore it and move on.
Receiving criticism, including bad quality criticism, is part of academic life.