Justice is just civilized version of revenge. It's tit for tat, but carried out by third party, and following clearly defined rules known ahead of time. "You do X, and the punishment for it will be Y." The impartiality, the prior clarity are all there to prevent escalation, while still providing the punishment (and the disincentive to do it in the first place).
Masamune is doing it personally, in response to what was done to him. That's revenge. And he's right to do it.
The question is whether he will go too far. And if his goal is to wipe out his entire class -- that's too far. Punishment must be proportional to the crime and the culpability. And yet... He is right that the rest of the class does bear some degree of culpability for his bullying.
Dragon's Heart is essentially an extrajudicial justice group. I.e. vigilantes. They're not doing it in response to wrongs done to themselves, but rather wrongs done to other people. One can argue that they're going beyond pure justice. However, some of the "innocents" that they're killing are people that knew about the crimes, and could have done something about the crimes, but didn't. Guilt by inaction. However, even that shouldn't apply to children. At best, you can only justify this as an action like war, in which innocents necessarily die.
A complicating factor here is this comes from Japan, which is less driven by morality and more driven by purity. So it this series ends up seeing a problem with Masamune, it's more likely to be associated with his having been "tainted" by the actions that he takes. (E.g. consider Demon Slayer Train Arc where we get a very clear picture of how insanely pure the hero's soul is -- i.e. it's not just that he's nice, but rather that his soul is pure.) Japanese authors usually don't look at "justice" the same way the west does.
I'll note that there's a lot of nuance and variance in this work. E.g. look at Reyd Black in the Reynault kingdom. Masamune directly equates him to Saeki (Masamune's number one bully). Reyd just straight up tries to murder Masamune just because Masamune is an unknown. And this guy is the number two "white knight" of the kingdom. Does he get punished for this? Not at all. So what's that say about the kingdom that employs him? At best they're realists who find bastards like Reyd to be useful.