When you're a true believer in man-made global warming, obviously. If you lie under those circumstances (or commit identity theft or forge documents or try to sully the reputation of a think tank or its employees through smears leaked to the left-liberal press) you are not a bad person at all. You are a hero!
How do I know this? Because an expert says so in the Guardian. His name is James Garvey (author of a book called "The Ethics of Climate Change," so he must know his stuff, right?) - and he's discussing the affair known as Fakegate - or Gleickgate - in which well-known climate activist Peter Gleick used what you and I might consider underhanded, nay, downright immoral and unlawful methods to try to blacken the reputation of the Heartland Institute.
What Heartland is doing is harmful, because it gets in the way of public consensus and action. Was Gleick right to lie to expose Heartland and maybe stop it from causing further delay to action on climate change? If his lie has good effects overall – if those who take Heartland's money to push scepticism are dismissed as shills, if donors pull funding after being exposed in the press – then perhaps on balance he did the right thing. It could go the other way too – maybe he's undermined confidence in climate scientists. It depends on how this plays out.
Liberals: gotta love their sense of humor!