It was the end of term at Lincoln University's student halls – the last night before the 2014 Christmas break – and the place was buzzing. There was a party going on in almost every room, with students keen to have one last big one before going home to their families.

Ashley Hughes and Luke Green, both 19 and on the same Mechanical Engineering degree, had become good friends after meeting at freshers week a few months earlier; both were middle-class kids who had never been in trouble with the law. Along with another friend, the three of them decided to buy some ecstasy pills from a student they knew.

By daybreak, their world had turned on its head. Ashley had collapsed, paralytic on the floor in front of his friends, from an MDMA overdose. As doctors fought to save Ashley's life in hospital, police arrested Luke on suspicion of drug supply. Locked in a police cell, Luke was told that Ashley had died overnight, before being told he was being released.

The mixture of grief and shock at seeing his friend die in front of him, and fear about what would happen to him, turned Luke into a recluse. He drank himself into hospital. In July of 2015, eight months after Ashley's death – and despite constant assurances from his solicitor that his case did not warrant a custodial sentence – a judge at Lincoln Crown Court ordered Luke to serve 12 months in Glen Parva, Britain's most violent young offenders prison.

Four years down the line, having slowly tried to rebuild his life, it is an experience Luke is still unable to talk about without breaking down in tears. The question is: did he deserve it?

Luke Green (right) on the BBC's website

In the last four years, largely due to increasing purity, there have been 226 ecstasy-related deaths in England and Wales. For every one of these tragic deaths, there are parents, relatives and friends still in mourning.

Around half of those killed after taking ecstasy are teenagers and people in their twenties, many of whom got their drugs from friends and acquaintances. Rarely do people buy recreational drugs from cartoon street corner pushers they've never met. Passing on, sharing or selling ecstasy to their mates is something tens of thousands of people do every weekend in this country. But what happens to those young people, in similar situations to Luke Green, who pass on the pills or powders that end up killing people?

A VICE investigation into past cases in the UK has found a trail of ruined lives and unjust treatment, where sharing drugs with friends can turn teenagers into heartless "death dealers", regardless of whether they intended to cause harm or could easily have died themselves. They are being unfairly pursued and punished by police, judges and the media, based on outdated attitudes towards people who use and buy drugs, and increasingly against the wishes of the relatives of those who have died.

In the hunt for someone to take the rap, police exaggerate people's role in the drug trade. Judges hand out overly harsh sentences to send out a tough message, while the media acts as a lightning rod for the scapegoating of people who are already traumatised.

One teenager pilloried in the media after being convicted of supplying ecstasy to a friend who later died in an accident told VICE: "It was the worst double whammy I could get. My friend dying and me being arrested in connection to it. He asked me if I had any MDMA powder and I gave him some. Next thing I know, the police came bursting into my room in the middle of the night and told me he was dead, just like that.

"They tried to make out I was a big dealer, going through my phone. I buy drugs, but I've never sold drugs in my life. I had some poker game scores on my phone and they tried turning that into me being a drug dealer. They played on the fact I was naïve and I'd never been in trouble before; I was easy pickings for them. The media made out I was a drug dealer who was responsible for my friend's death. It was hard to cope with."

Police and the Crown Prosecution Service do not normally pursue cases of possession or supply involving small amounts of any drug, including ecstasy. Yet, when someone dies, this mitigation is quickly discarded.

Last week, Media Studies graduate Katie Lavin cried in court after being given a six-month jail sentence for class A drug supply following the death of her friend and housemate, Joana Burns, in Sheffield last June. Along with a group of their friends, the pair – Joana was 22 and Katie was 21 – had decided to pool their money and buy some ecstasy to help celebrate their graduation from university. It was Katie who bought the drug on everyone’s behalf from a barman she knew, so it was Katie – still grieving from the death of her friend – who was arrested, charged, convicted and jailed for drug supply, and who was labelled by the BBC last Friday as the "Drug dealer jailed for providing MDMA to a university student who died".

Jailing Lavin, Jeremy Richardson QC told her: "Quite how an intelligent young woman, as you are, could do such a foolish thing is almost beyond understanding. You have wrecked your future." Sentencing 26-year-old Benjamin Williams, the barman who sold Katie the ecstasy, to two-and-a-half years in jail, the judge said he would be "failing in his public duty" if he didn't send them both to prison: "You in differing ways have each played a role in the death of a young woman. You each will have to deal with that for the rest of your lives – you are the architects of this catastrophe that you visited upon yourselves. Ecstasy is a class A drug for a reason. It's an exceptionally dangerous drug."

In reality, ecstasy is not an "exceptionally dangerous drug", and passing a pill to your friend is not "beyond understanding". Those who do this are not as reckless as they are made out to be by judges, and therefore their level of culpability is nowhere near as great. Home Office figures, which are known to underestimate drug prevalence, show that 550,000 people admitted taking ecstasy at least once last year in England and Wales. Even if they only took the drug twice, that's 1.1 million doses last year. Yet the number of deaths linked to ecstasy recorded in 2017 was 57. Ecstasy can undoubtedly be lethal, but it's not the narcotic "Russian roulette" (a one in six chance of death) it's made out to be by the authorities.

When judges talk about having a public duty to jail people like Katie Lavin, it is a deterrent – a warning to young people to avoid anything to do with ecstasy. Do young people heed these messages from judges? It appears not. In 2018, ecstasy remains a staple drug of choice, and the proportion of 16- to 24-year-olds using the drug is higher than it was ten years ago.

Considering those who pass on or sell drugs that turn out to be fatal are likely to already be feeling guilty – especially if it's their close friends who have died – who is this harsh justice meant to serve? Not those who have died, say the loved ones who spoke to VICE.

Before Katie Lavin's sentencing, Lewis Birch, the boyfriend of Joana Burns, said: "I know for a fact that Joana would be upset that Katie has to go through this. Picking up drugs from a dealer for a group of friends she was a part of is not dealing drugs. This was the first time Katie had collected them for us. It could have been anyone of us in her place." At a court hearing last month, Joana's mum Mosca made it clear she did not want Katie or Benjamin to be jailed either.

Sixteen-year-old Luke Campbell died last year after taking ecstasy at an under-18s disco in Ilfracombe, Devon. He'd bought pills before the party, from a 17-year-old friend. That friend had been selling pills within his social circle for about five months, sourcing them through a 16-year-old who was buying the pills on the dark web using bitcoins. The judge was going to sentence Luke's friend to 18 months in jail, and also send the 16-year-old boy to prison, had it not been for Luke's family stepping in.

In a letter to the judge, which was read out in court, the family wrote: "We are not here today to seek vengeance. We know that Luke decided independently, and without coercion, to take ecstasy to celebrate his last day of school. Luke would not want another person, especially his friend, to be held accountable for what happened to him that night. For us to know that two more boys are going to be negatively affected because they are facing a custodial sentence will exacerbate the impact of the offence on us. We have lost Luke's life, and we do not wish for any more young men to lose theirs."

Instead, Luke's friend was given a suspended jail sentence and 200 hours unpaid community work, and the young boy a six-month curfew. Both boys have helped Luke's family make drug harm reduction education videos to be shown in schools. Luke's family are also working with drugs charity Anyone's Child to campaign for drug law reform.

Photo: Westmacott / Alamy Stock Photo

Sometimes, those who unwittingly hand fatal doses to their friends are not identified by the police, yet through fear of what the law will do to them, they keep quiet, which is not helpful for grieving families.

Janine Milburn – whose teenage daughter Georgia died in May after taking ecstasy at Mutiny Festival in Portsmouth – says: "None of her friends has owned up to being with her. So they are dealing with their own guilt and grief in quiet. They must be horrendously scared. Hiding this big secret is not good for anyone. But it was her choice to take it. There isn't always someone to blame. These people are not criminals; they are kids doing what kids do."

Dominic (not his real name) was 17 when he sold some ecstasy pills last year to a friend who died from an overdose. When he heard his friend had died, he panicked and could not leave his home. "I was freaked out – I didn't know what to do. I was too scared to do anything so I stayed inside the flat. I didn't see anyone," he says. "I was heartbroken. I’d lost a mate and I felt responsible for the pain that anyone who knew him – his family, friends – were feeling. I was responsible for their loss. I was also worried that I'd be in a lot of trouble. I was going to hand myself in, but I was scared I'd go straight to prison for ten years. It was a terrifying."

In the end, Dominic ended up confessing everything to the police. "I burst into tears and told them. It wasn't worth lying about." Five months later he got a letter from the police saying he was being charged with the supply of class A drugs. "I knew I wouldn't survive prison, that I'd probably top myself," says Dominic. "I'm not a tough guy – I knew I'd probably get beaten up every day, I'd be called a murderer. It was the worst possible scenario." Luckily for Dominic, the parents of the boy who died appealed for clemency and he avoided prison.

This fear can also result in people being too scared to dial 999 while someone is overdosing because they are worried they will be sent to jail. In 2015, five teenagers, all aged 16 and 17, were convicted of perverting the course of justice after dumping their dying friend in a country lane because he was dying of a drug overdose.

The pill giver has been hunted down for decades. The tone was set when Leah Betts, a policeman's daughter, died after taking ecstasy on her 18th birthday in Essex in 1995. Her hospital photo was on every front page. Public outrage led to a stampede of East End gangsters declaring that they would be the first to find and punish the person who had sold it to her. Ever since then, friends who have handed drugs to friends have been treated with the same disdain as large scale distributers.

"Even Boy George was quoted in an article saying it was ridiculous I was in prison for one pill," says Joanna Maplethorpe, speaking 21 years after she was jailed for giving her friend one ecstasy pill on her 21st birthday, in 1997. Then a 22-year-old marketing assistant from Surrey, Joanna gave the pill to her friend Alexandra Thomas, who was very drunk and suffered an extreme adverse reaction. She was taken to hospital and made a full recovery, but Joanna was still jailed for nine months.

Joanna says she went mute in jail and was put on a course of strong anti-depressants. Upon release, she was pursued by the media and found it hard to get a job. "It's totally fucked my life," she says. "I hate a lot. I'm on medication. It's a chain around my neck. People at work google me and tell me when they're pissed that they know I've been in jail for class A drug supply."

Of course, it's not just in Britain that this goes on. In America, the land of wild drug policy contradictions, sharing drugs can lead to a charge of drug-induced homicide. Last year, the New York Times carried out a year-long investigation into the targeting of heroin users with this crime, which found that US prosecutors are increasingly treating overdose deaths as homicides despite no intent of harm by those sharing the drugs.

But as the research points out, this is not just happening within the heroin community. In 2012, Timothy LaMere was sentenced to ten years for third degree murder after he shared the psychedelic drug 2C-E at a house party in Blaine, Minnesota. Everyone fell ill and his best friend, 19-year-old Trevor Robinson, died.

The authorities were relentless. According to an investigation by the local newspaper in Minnesota, LaMere was threatened by the US Attorney's Office with a potential 20-year sentence if he didn't plead guilty to the homicide charge. It also revealed a steep rise in Minnesota of the number of people being sentenced to third-degree murder linked to drug supply. In the five years before LaMere's conviction, ten people were sentenced for this crime, yet in the five years since, 29 were sentenced. Timothy, who had bipolar disorder, was released last year, but died of a heart attack in April.

In 2015, Abhimanyu Janamanchi snorted a very strong synthetic cannabinoid powder with other students at a party at Wesleyan University in Connecticut. His heart stopped and he was saved by a defibrillator, but was arrested, charged with distributing drugs and possession of marijuana, and briefly jailed before being put on a rehab programme – meaning he was arrested and jailed for nearly dying from a drug overdose.

In the UK, there is general agreement from most of the people involved in these cases – those who have been punished for supplying drugs and the friends and families of those who have died – that the status quo is not helping anyone.

Most agree that there needs to be a separate crime of "social dealing", which accepts that people who pass on drugs to friends for no or little financial gain should not be treated the same as those who make a living out of drug selling. They should not be dragged through the courts on the pretence that they set out to do harm, nor punished as a way to send a message. The best way to keep young people safe is more harm reduction information and drug checking facilities. Some say that decriminalisation and regulation will help save lives and reduce crime, others just advise people not to go near MDMA, nor sell it.

"It's hard not to think about Ashley," says Luke Green now. "There are lots of reminders. But I don't want to forget him."

Luke's time at Glen Parva back in 2015 was as bad as he had imagined. He was beaten in the showers, threatened by a thug murderer on a daily basis, and saw prison riots and a block set on fire. He was branded a "monster" by the Daily Mail. While those who had been inside for stabbing people were allowed out early on tag, this was refused for Luke because probation officers said it would "attract adverse media attention" and "likely damage public confidence".