The problem with middle/intermediate schools in general is that no adult is responsible for any particular student - unlike elementary school, where each student has a teacher who is responsible for them.  Lacking supervision, children are inclined to test their limits.  The answer is simple (after all, this is what the private schools all do) - keep class sizes smaller through middle/intermediate school and require each student to be actively mentored by a teacher, so that if the child is having any issues - academic, social, etc. - the teacher can reach out to the student and the parents promptly.  Most of all, the parents need to stay involved.