It ended for one man with a weeping confessional about how much he missed his mum. Another told us he had a shameful preference for instant coffee. A few couldn't remember their own names. Many screamed at the top of their lungs into the microphone. Quite a few got naked in the glow of pink neon before we swabbed them down with wet wipes.

It began at the entrance to a giant white cube, the Decontamination Unit, amid the muddy mess of Glastonbury. Bewildered guests – who thought it was a night club – were greeted by two guides in biohazard suits, who led them to a Microbial Zoo: an array of colourful Petri dishes bearing swirls and stripes and spots of rainbow-coloured bacteria.

Some of the strains produced these artful patterns all on their own. Proteus mirabilis, with to its whip-like tails, swims in circles at high speeds through the agar, producing concentric rings.

The Decontamination Unit. Photograph: Guerilla Science

"Drawing people in like this helped them to learn that you really wouldn't be able to live without these 'dirty, disease-causing things'," says Sarah Forbes, a microbiology PhD student at the University of Manchester, who grew the plates. She gives the example of Staphylococcus epidermidis, which lives on our skin and prevents other more virulent bacteria from taking hold.

The exercise was part of the latest experiment by Guerilla Science, which aims to introduce non-scientists to the beauty and relevance of our favourite subject by mixing it into arts and cultural events – places where people don't expect to see science, and where we can reach more people who would probably avoid anything to do with it, perhaps after experiencing dull, rote exercises at school.

"We have strived to bring science in unconventional ways into unconventional places - and this was definitely the strangest project we've delivered at a music festival yet," says Guerilla Science director Jen Wong.

The Microbial Zoo. Photograph: Guerilla Science

Muddy punters, leaning forward to hear over the cacophonous grimecore coming from next door, were horrified to learn that our bodies are home to thousands of species of bacteria. A kilogram of bacteria reside in our guts alone, and overall we host 10 times as many bacterial cells as our own cells.

Perhaps most shocking of all for the muddy revelers was the fact that they encountered this display in Shangri La – the riotous after-hours "naughty corner" of Glastonbury. Next door was the Snake Pit, nightly filled with appropriately filthy electronic dance music; across the way was the Slumba Rave (featuring a caged arena for pillow fights); and all around the Decontamination Unit was a sprawling, slum-like collection of art installations and micro venues, populated with dead baby doll heads, neon lights, and mannequins placed in extremely compromising positions.

Bringing scientists into one of the most rebellious arenas in Glastonbury was the brainchild of Debs Armstrong, creative director of Shangri-La, in partnership with Dr Amy Sanders at the Wellcome Trust, which has been organising a series of events celebrating dirt. "Glastonbury seemed an obvious choice: organisers and visitors have to deal with copious mud and dust, limited showers and loos, and numerous humans (and their germs) in close proximity," says Dr Sanders.

"This year I wanted to bring some scientific content to Shangri-La - give the narrative a bit more meat," says Armstrong. "There are so many interactive artistic installations that are very creative, but to bring actual science into the fold is altogether different, and rarely done."

Shangri-La revolves around the story of a city, born as a hedonistic dystopia in 2009, and this year stricken with a fantasy "virus" – in the form of UV reflective paint – contaminating everyone who wound through the city's maze of venues.

With the support of the Wellcome Trust as part of its Dirt Season, Guerilla Science was brought in to cleanse citizens of the virus.

For eight hours daily for three days, we "decontaminated" the muddy revellers who wound their way through a network of hexagonal chambers inside our giant white cube.

As part of the narrative of the Decontamination Unit, following their lesson in microbiology, guests could opt for one of two kinds of disinfection: physical, which led to an undressing room (yes, many people opted to get completely naked) and then a smoky, strobe-lit shower; and moral, which led to a private session with bona fide psychiatrists: Dr Mark Salter, Dr Peter Macrae, Dr Priscilla Kent, and Dr Caroline Methuen.

Moral decontamination involved an intimate, personalised session lasting however long the patient needed, resting their tired legs on a couch while two shrinks sat in red-leather armchairs counselling them in preparation for the next room: the Shame Drain, where they could share a guilty secret with a microphone. Their words were broadcast anonymously through a row of speakers opposite the Decontamination Unit.

"Some people just lay on the couch straight away – I was surprised at how quickly people bought into the idea that confession in itself could be a cleansing experience," says Dr Methuen. "Some really got into the idea of sending an idea out to the ether, sharing it anonymously with other people – a way of getting rid of the guilt you unnecessarily carry inside you. Even when they were off their heads, they got it."

Some were too off their heads (it was Glastonbury after all) to remember their own initials. But for most the psych chamber was useful, says Methuen. Some joked. Others basked in the attention. A few cried. One wept about how much he missed his mum.

"There are still negative stereotypes about psychotherapy, so it was useful to show what a flexible thing it is – you don't fit into a conveyor belt," she says. "We were all nice, friendly and non-threatening. We were just having a chat – and in the chaos of Glastonbury, the normality of sitting down and being asked how they were was quite therapeutic in itself."

Guerilla Science would be lying if we said it wasn't all a bit trying at times: the combination of mud, sleep deprivation and occasionally addled revellers were challenging. But it was worth it to introduce a scientific note to one of the world's most popular music festivals.