GlaxoSmithKline was sued by the New York attorney general for 'illegal and deceptive' reporting of the risks of its anti-depressant Seroxat. Photograph: Jack Sullivan

This week the drug company AstraZeneca paid out £125m to settle a class action. More than 17,500 patients claim the company withheld information showing that schizophrenia drug quetiapine (tradename Seroquel) can cause diabetes. So why do companies pay out money before cases get to court?

An interesting feature of litigation is that various documents enter the public domain. This is how we know about the tobacco industry's evil plans to target children, the fake academic journal that Elsevier created for Merck's marketing department, and so on.

One of the most revealing documents ever to come out of a drug company emerged from an earlier quetiapine case: an email from John Tumas, publications manager at AstraZeneca. In it, he helpfully admits that they do everything I say drug companies do.

"Please allow me to join the fray," Tumas begins, in response to a colleague. "There has been a precedent set regarding 'cherry picking' of data." Cherry picking is where you report only flattering data, and ignore or bury data you don't like. The ears of lawyers prick up at any use of the word "bury" in relation to drug company data, as it implies something deliberate, and luckily John uses this word himself. The precedent, he explains, is "the recent … presentations of cognitive function data from trial 15 (one of the buried trials)".

In trial 15, commissioned by AstraZeneca, patients with schizophrenia who were in remission were randomly assigned to receive either AstraZeneca's quetiapine, or a cheap, old-fashioned drug called haloperidol. After a year, the patients on Seroquel were doing worse: they had more relapses and worse ratings on various symptom scales. These negative findings were left unpublished: to use Tumas's word, they were "buried".

But in among all these important negative findings, on a few measures of "cognitive functioning" – an attention task, a verbal memory test – Seroquel did better. This finding alone was published in a research paper in 2002. AstraZeneca kept quiet about the fact that patients on Seroquel had worse outcomes for schizophrenia. The research paper went on to become a highly influential piece of work, cited by more than 100 academic research papers. Many researchers can only dream of publishing such a well cited piece of work.

Trial 15 also found that patients on Seroquel gained, on average, 5kg in weight over a year. This put them at increased risk of diabetes, which is what AstraZeneca is now paying to settle on (and in any case, a 5kg weight gain is a serious side-effect in itself).

Psychiatric drugs can do more good than harm overall, but many have serious, common side-effects. It is especially important that doctors and patients know all the risks, so that sensible and informed trade-offs can be made.

Here is the opening of another email in that quetiapine case. Richard Lawrence writes in an internal memo to colleagues: "Lisa has done a great smoke and mirrors job" on trial 15.

The pharmaceutical industry's behaviour has collapsed into farce. Doctors and academics – who should feel optimism at working with the drug companies to develop new treatments – feel nausea instead, knowing that there are only informal systems to deal with buried data, and these have clearly failed.

In 2005 the International Committee of Medical Journal Editors put its foot down and said its journals would only publish trials that were fully registered before they started, which should make any that went missing much easier to spot. Several years later, as recorded in this column, fewer than half of all the trials that the editors published had been adequately registered, and more than a quarter were not registered at all.

After the New York attorney general sued GlaxoSmithKline over its "illegal and deceptive" reporting of the risks of its anti-depressant paroxetine (tradename Seroxat), GSK agreed to publish all trial data on a website. But, several years later, we saw last month that GSK and the Food and Drug Administration had sat on data showing that rosiglitazone (tradename Avandia) increased the risk of heart problems.

I can't see why any company withholding data should be allowed to conduct further experiments on people. I can't see why the state doesn't impose crippling fines. I hope it's because politicians don't understand the scale of the harm.