Would Copernicus and Galileo have been right to lie about the nature of the solar system if that lie prevented the undermining of the Catholic Church, which most everyone at the time felt to have substantial positive benefits?
I think the answer for most of us is "no." Science is about finding the truth, and the effects of those truths on social and political institutions are what they are.
But we have now entered the era of post-modern science, where writers on scientific ethics now conclude that its OK for scientists to lie as long as they are on the right team
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.
Post-modernism has been quite fashionable in the social sciences for decades, but this entry into the hard sciences is new and disturbing. For reference, here is the Wikipedia entry on post-modernism
In its most basic form, postmodernism is an intentional departure from the previously dominant modernist approaches such as scientific positivism, realism, constructivism, formalism, metaphysics and so forth. In a sense, the "postmodernist" approach continues the critique of the Enlightenment legacy, fundamentally seeking to challenge the traditional practices and intellectual pillars of western civilization just as the Enlightenment challenged tradition, theology and the authority of religion before it.
Postmodernism postulates that many, if not all, apparent realities are only social constructs and are therefore subject to change. It emphasises the role of language, power relations, and motivations in the formation of ideas and beliefs. In particular it attacks the use of sharp binary classifications such as male versus female, straight versus gay, white versus black, and imperial versus colonial; it holds realities to be plural and relative, and to be dependent on who the interested parties are and the nature of these interests. It claims that there is no absolute truth and that the way people perceive the world is subjective.
"Fake but accurate" is a good example of post-modernist thinking.