True. If the law took that into consideration, and precedent indicated that creatures that are most likely Evil are deserving of death unless evidence indicates that they are Neutral or Lawful or Good, then his actions would not have been justified. However, Larks indicated that that is not the case: goblins are considered innocent until proven guilty. Larks’ character thus, refusing to be an accessory to illegal vigilante justice, attacked their party in self-defense on the goblins’ behalf. In the long-term, successfully preventing the goblin’s deaths would cause more legal violations, yes, but legally, they’re not responsible for that. (I assumed the legal system is relatively similar to that of modern America, based on the “innocent until proven guilty” similarity and Conservation of Detail.)
Of course, if they assigned negative utility to all violations of law in proportion to severity and without respect for when they occur or who commits them, the best position would be as you described, and their actions were incorrect.
Assuming: any given goblin is Evil with p=0.95
Assuming: 80% of Evil creatures are guilty of a hanging offense according to an authority
Assuming: 5 randomly-selected goblins in the group
The probability that all members of the group deserved death according to authority should be (0.95*0.8)^5 = 0.254.
Of course, that last assumption is a bit problematic: they’re not randomly selected. Still, depending on the laws, they might still be legally entitled to a trial. Or perhaps the law doesn’t consider being a member of an Evil race reasonable suspicion of crime, and they wouldn’t even have been tried by Lawful Authorities.