I think the legal principle here is that of a superseding cause. The case law on this matter is really complex and I, as someone who is NOT a lawyer, cannot comment on the merit of the judge’s decision. However, the case described in that Wikipedia article is illustrative:
if a defendant had carelessly spilled gasoline near a pile of cigarette butts in an alley behind a bar, the fact that a bar patron later carelessly threw a cigarette butt into the gasoline would be deemed a foreseeable intervening cause, and would not absolve the defendant of tort liability. However, if the bar patron intentionally threw the cigarette butt into the gasoline because he wanted to see it ignite, this intentional act would likely be deemed unforeseeable, and therefore superseding.