It sounds as if there are bullies at the school who attacked Danny. It could be homophobia or it could be because of his fostering status. I can’t remember if he’s still going to the same school as his boyfriend, but I’m guessing not.
I wouldn’t expect Danny to flirt with another guy, but it’s very likely that some straight Neanderthal caught Danny admiring him and didn’t appreciate it. Or thought Danny was staring at him – Danny could have been daydreaming about his boyfriend or about Steve & Kate and not really looking at anything. Or it could have been the notorious erection that was noticed and falsely attributed to the Neanderthal…
At some point, even the calmest among us can reach a point where they get so frustrated that they explode. When you suppress your emotions too much, they burst out with more force than if you’d released it sooner. There needed to be a shock to get The Major to do what even he knew deep down inside was the right thing. It was habit that caused him to stubbornly refuse to cooperate. I predict that Kevin & Ian will need to figure out a strategy to prevent The Major from pulling this sort of trick too often.