Her generous ear, maternal instinct and wonky half-smile gave Hayley a full three dimensions … Julie Hesmondhalgh with David ­Neilson, left, in Coronation Street

There is a poignant moment in the Morrissey autobiography where the author happens upon the shooting of a Coronation Street episode in the 1970s. "Television is the only place where we banish ourselves from the community of the living," he says, "and where the superficial provides more virtue than the actual." I read these thoughts the day after Hayley Cropper had been lead around the parquet dancefloor of Blackpool's Empress ballroom by her husband Roy as the Wurlitzer organist played Close to You. In late July, Hayley was diagnosed with terminal pancreatic cancer. On her return from Blackpool, she told Roy of her decision to end her own life when the time felt right. All of it slotted into the tradition of bold pathos locked into tender northern storytelling.

For Coronation Street fans, the denouement of Hayley Cropper is stinging long and hard. History will likely judge it among the saddest of Weatherfield exits. In her own small way, Cropper has changed the way we watch soap opera. She has shifted a corner of the national debate into warmer, more inclusive terrain. Roy and Hayley are one of the few outposts in soap you can turn to for moral virtue. Among the serial killers, pin-ups, playboys, alcoholics and adulterers of contemporary Corrie, the couple in the zip-up cardigan and the red anorak have become an unlikely symbol of purity.

Roy and Hayley defy television's glamour axis. Hayley was introduced as the punchline to a clumsy gag, reflective of less enlightened Corrie times. In 1997, it was not right but it was OK to make primetime jokes at the expense of the British margins. The producers had decided that perennial middle-aged virgin and fusspot Roy was ready to seek companionship. Hayley was to be the first in a string of disastrous blind dates he had organised after posting a lonely hearts ad. The intended joke was that Hayley was a pre-op transsexual born Harold Patterson. Trust Roy! It quickly, magically backfired, as the discreet chemistry between actors David Neilson and Julie Hesmondhalgh lit up a quaint corner of the screen.

Roy and Hayley's modern storyline has been played straight and old-fashioned, carrying with it a notoriously rigid audience resistant to moving with the political moment, let alone surpassing it. Hayley was whipped off to Amsterdam to complete her gender reassignment surgery and an initially affronted Roy strode into town to declare his love. They married in an impromptu ceremony, not legally recognised, in his newly acquired greasy spoon, Roy's Rolls, aided and abetted by the character at the centre of the last heartbreaking Coronation Street cancer demise, Alma Sedgewick.

This was a time just prior to the parochial, then national recognition, of the gay village circumnavigating Canal Street as one of Manchester's social heartlands. It predated Channel 4's pivotal gay drama Queer as Folk by two years and transgendered Portuguese starlet Nadia Almada winning Big Brother by seven. It was eight years before civil partnerships became recognised in statute and Elton and David validated the legalese for suburbia. It is astonishing, in retrospect, to be reminded that Coronation Street's first LGBT character and foreground storyline was T.

'The tide comes in quickly' … Hayley and Roy in Corrie

The beauty of Hayley – and it's a testament to the brilliant actress who plays her – is that she has never been just a T. She is foremost, always, an H. Humanised at every corner by her soft delivery, generous ear, calm, maternal instinct and wonky half-smile, Hesmondhalgh has gifted Hayley a full three dimensions. She and Roy have spun a spider's web of friends throughout the Street and, in malevolent Tracy Barlow, one enemy. Roy and Hayley's love affair has been Corrie's take on a Burton and Taylor moment, as if enacted over a lager and lime in Napoleon's, the boozer on the corner of Bloom and Sackville Streets that has warmed and watered the city's real-time Hayleys since the 1960s.

Figuratively, the effect of Hayley Cropper, Coronation Street's first transgender character, is trickier to quantify. When she first appeared in Weatherfield, Hayley became instant target practice for the prejudices of the Sun's then TV columnist Garry Bushell. His campaign of ire hasn't relented with quite the withering speed of his influence over the years. "Hayley Cropper's real health issue?" he wrote in the Daily Star in July, upon the character's terminal cancer diagnosis: "Ingrowing testicles!"

As one writer full of prejudices reverses from view, more enter centre-stage. When Michael Singleton, the coroner in the case of transgender Accrington primary school teacher Lucy Meadows delivered his verdict on her suicide in March this year, he pointed out her treatment at the hands of the press for special criticism. He used the words "ridicule and humiliation", "character assassination" and finished with: "And to you, the press, I say, shame on all of you."

When Hesmondhalgh bows out as Hayley Cropper in January, she will take a bucketful of tears with her. "The tide comes in quickly," she said to Roy as they stood in the shallows on a stunning, grey Blackpool beach last week. The inference was clear. Neilson has said that viewers respond to the couple because of their decency. For Hayley, those still waters run deep. In a soap world of self-interest and ambition, bed-hopping and backstabbing, she represents goodness. Hesmondhalgh leaves an open goal for producers, too. The next time they want a transgender character, perhaps they can employ a transgender actor to play them. There surely couldn't be a better way of honouring their accidental tumble into the 21st century with Hayley back then.