David Daleiden committed trespass as a matter of law. Whether he was morally justified is something that can be debated. He is clearly strongly opposed to abortion, and some would support his law breaking as equivalent, say, to those breaking laws in Nazi Germany to protect Jews. Whatever your views on this, the judge has a duty to decide cases on the basis of the law, not whether she is sympathetic to the accused's motives. The jury can certainly take the motives, in addition to other factors, into account in deciding damages.
On the Pentagon Papers, Elisberg committed crimes, was indicted, and would have gone to jail. Paradoxically, the interventions of Nixon's White House to deny Elisberg a fair trial acted in Elisberg's favour.