Some judges make mistakes, no doubt about it (appeals courts are there for a reason).
However, as has been pointed out above, the judge may well have applied the law entirely correctly if there was sufficient evidence that deportation would be a risk to this criminal. In which case, the decision might have been correct legally, even if it stinks from a moral standpoint.
If that’s the case, your frustration may be better aimed at the law makers.