The Seventh Doctor and Ace visit a human colony on the planet Terra Alpha, and are unsettled by the planet's unnaturally happy society. Cheerful music plays everywhere; the planet's secret police force, the Happiness Patrol (governed by the vicious and egotistical Helen A, who is obsessed with eliminating unhappiness), roam the streets wearing bright pink and purple uniforms, while they hunt down and kill so-called 'Killjoys', and the TARDIS gets repainted pink so as not to look depressing. While exploring the planet, the Doctor and Ace encounter Trevor Sigma, an official galactic census taker, who is visiting Terra Alpha to discover why so many of the population have disappeared.

The Doctor and Ace have a brief period of incarceration in the Waiting Zone (Terra Alpha's version of prisons), to find out more about the planet's laws against unhappiness, and meet unhappy guard Susan Q, who becomes a firm ally, and allows Ace to escape when she is taken away from the Doctor to be enrolled in the Happiness Patrol. The Doctor, meanwhile, encounters another visitor to the planet, Earl Sigma, a wandering harmonica player who stirs unrest by playing the Blues. Earl and the Doctor venture to the Kandy Kitchen, where most of the missing population of Terra Alpha vanished to, and discover Helen A's twisted executionist, the Kandy Man; a grotesque, sweet-based robot, created by Gilbert M, one of Helen A’s senior advisers.

The Doctor manages to outwit the Kandy Man by gluing him to the floor with lemonade, and he and Earl escape through the candy pipes below the colony, where dwell the native inhabitants of Terra Alpha, now known as Pipe People. They want to help overthrow the tyranny of Helen A. The Doctor returns to the surface, and begins stirring up trouble, supporting public demonstrations of unhappiness, encouraging the people to revolt, and attempting to expose Helen A's 'population control programme' to Trevor Sigma.

Ace and Susan Q have meanwhile both been recaptured, and have been scheduled to appear in the late show at the Forum, where the penalty for non-entertainment is death. The Doctor and Earl rescue them both, and the four head off to Helen A’s palace for a final showdown, while a revolution takes full effect outside the palace walls. The first to be disposed of is Helen A’s pet Stigorax, Fifi, a rat-dog creature used to hunt down the Pipe People, which is crushed in the pipes below the city when Earl causes an avalanche of crystallised sugar with his harmonica. Then the Pipe People destroy the Kandy Man in a flow of his own fondant surprise (previously used to drown Killjoys). Realising that she is beaten, Helen A attempts to escape the planet in a rocket, only to discover that the rocket has already been commandeered by Gilbert M and Joseph C, her husband. She tries to flee, but the Doctor stops her, and tries to teach her about the true nature of happiness, which can only be understood if counterbalanced by sadness. Helen A at first sneers at the Doctor; but when she discovers the remains of her beloved pet Fifi, she collapses in tears, and finally feels some sadness of her own. The revolution complete, the Doctor and Ace slip away, leaving Earl, Susan Q and the Pipe People to rebuild the planet – but only once the TARDIS has been repainted blue.

Working titles for this story included The Crooked Smile.[3] The production team considered transmitting this story in black and white to fit with its intended film noir atmosphere.[3] A fan myth holds that the third episode was supposed to be animated, but this was never the case.[4] The entire serial was shot in studio in July and August 1988.[5]

Patricia Routledge was originally going to play Helen A,[citation needed] but Sheila Hancock was later cast. Helen A was intended to be a caricature of then British Prime Minister Margaret Thatcher.[6] Hancock stated that she "hate[d] Mrs Thatcher with a deep and venomous passion".[5] In 2010, Sylvester McCoy told the Sunday Times: "Our feeling was that Margaret Thatcher was far more terrifying than any monster the Doctor had encountered". The Doctor's calls on the drones to down their tools and revolt was intended as a reference to the 1984-1985 miners' strike.[6] Most of this element was eventually toned down.[3]

Ian Berriman of SFX wrote that The Happiness Patrol was "far superior" to Dragonfire, particularly praising the Kandyman and the supporting cast. However, he felt that "while the script is brimming with witty, provocative ideas and droll one-liners, it struggles to piece them together into a satisfying narrative".[10]Radio Times reviewer Patrick Mulkern described it as a "clever and funny satire" and praised the acting and political commentary.[5]DVD Talk's John Sinnott gave The Happiness Patrol five out of five stars, calling it a "minor masterpiece". He commended the irony, social commentary, and McCoy's acting.[11]

However, this story is also often used as an example of how the show declined during the 1980s. A clip was used in a 2001 show called "Top Ten: Sci Fi", to accompany an interview with Kim Newman in which he dismissed much of 1980s Doctor Who as "A fairly shoddy pantomime of its former self", and a series of interviews in which people discussed the causes of the show's demise.[citation needed]

In the 2003 documentary "The Story of Doctor Who", clips from this story were used to accompany interview with Verity Lambert about how she disliked the show's later years, and an interview with Sylvester McCoy as he discussed why the show was taken off air.[citation needed]

In 2005, The Kandy Man's appearance was labelled one of the "50 Most Shameful TV Moments" in a Channel 5 show of the same name.[citation needed]

The scene where the Doctor talks two Happiness Patrol guards out of using their weapons by emphasising the easiness of the kill versus the enormity of ending a life received high praise.[who?][citation needed]

A novelisation of this serial, written by scriptwriter Graeme Curry, was published by Target Books in February 1990. Adapting his scripts rather than the televised version, Curry's book includes scenes cut during editing and his original envisioning of the Kandy Man with a human appearance, albeit with powdery white skin and edible candy-cane glasses. An unabridged reading of the novelisation by Rula Lenska was released by BBC Audiobooks in July 2009.