The police sometimes take it as part of their schedule to visit schools and teach the kids things regarding simple rules, laws, etc., at least in the U.K.
The officers in question probably saw they had time in their schedule and no calls to reply to, so used the opportunity to visit the school, "fake arrest" this child, and teach him, along with his whole classroom, a lesson on respect and whatnot.
No harm done, and now at least a few more kids in the world will think twice before acting like dicks. For about an hour or whatever of their schedule, probably worth it. A bit extreme maybe, but also probably very effective. The quality of parenting is a non-factor.