I am not in teaching but when my son was at school we always backed the school up in front of my son, a bit like you do with your partner/dh in front of the kids! I didn't always agree with the school and over the years had many a private conversation, but as far as my son was concerned, at home we made the rules, at school they made the rules and he was expected to follow them. If he didn't there were consequences. He has some specific learning difficulties, but he was never allowed to use that as an excuse to not do/do something he should not.
I also think that a lot of boys in particular do not have a positive male influence around them. Which means they look elsewhere for that male influence and then because their brains are not developed enough to choose the right things they go off the wrong way.
The other thing I see, is that a segment of parents seem to rely on the school to teach their kids everything. You see it in primary (predominantly female teachers) where 4/5 year olds are still in nappies, can't use a knife and fork, don't know how to interact appropriately with other kids or adults, parents expect the teachers to do all the sex ed talk, teach them about money, dangers of the internet, teach them how to cook. It's never ending.
Parents are failing to parent to their kids. Let's face it, it's hard work raising children and some parents opt out very early. Children like and feel safe with rules and boundaries, but they are hard to maintain so for some people it's easier not to bother and those kids are the disaffected ones, who have learned they just need to shout a bit louder and longer to get their own way. That then means they are easy pickings for lots of bad influences either in person or online.
There will always be an element of some kids are just bad, but parents need to take the blame as well, for not setting and keeping fair boundaries, not teaching their kids right from wrong, not making sure they have positive influences in their lives. If we could somehow sort that out, then maybe it wouldn't be so bad.