That's a part of it certainly, but I think there are other, more insidious things involved as well. First of all, the cops in these school stings aren't necessarily going after drug dealers, as much as they're attempting to turn kids into drug dealers in order to make arrests. Thus, the logic is that turning kids into drug dealers, leaving them with a criminal record and limiting their access to a decent education system, somehow improves the lives of children and their community.
The second part is that this sort of behavior betrays the trust that kids should have in their administrators and local law enforcement. And, in my opinion, good communities are the ones that have (justified) trust in their educational and law enforcement institutions. That's not good for any of those three parties going forward.