X Factor singer Rylan Clark has deleted a tweet in tribute of Margaret Thatcher, after being reminded of her role in introducing Section 28 and her general disdain for gay rights.

Clark tweeted: “Getting a bit of backlash about thatcher, maybe I’m not up on history???”

The Conservative former prime minister died on Monday, aged 87 from a stroke.

Introduced during the AIDS epidemic as part of the Local Government Act in 1988, Section 28 stated that a local authority “shall not intentionally promote homosexuality or publish material with the intention of promoting homosexuality” and that schools “could not promote of the acceptability of homosexuality as a pretended family relationship”.

Although she voted in favour of the decriminalisation of homosexuality in England and Wales in 1967, as prime minister from 1979-1990, Margaret Thatcher was the embodiment of social conservatism.

In 1987 at the Conservative Party Conference, Thatcher attacked “positive images” of gay people during her speech, saying she worried that: “Children are being taught that they have an inalienable right to be gay.”

Section 28 was later repealed under Tony Blair’s Labour government.

It did great damage to the reputation of the Conservative Party in the eyes of Britain’s gay electorate and the current Conservative Prime Minister, David Cameron, apologised for the policy in 2009.

Despite being a key critic, human rights campaigner Peter Tatchell said on Monday that Thatcher’s passing should not be a cause for celebration, but he stressed: “During her rule, arrests and convictions for consenting same-sex behaviour rocketed, as did queer bashing violence and murder. Gay men were widely demonised and scapegoated for the AIDS pandemic and Thatcher did nothing to challenge this vilification.”

In recent years, several conservative political commentators have argued that – in private –Thatcher could show a greater understanding towards homosexuality on an individual level than she would ever allow in her public persona.

Former Conservative MP Matthew Parris, an aide to Thatcher while she was leader of the opposition, said the former prime minister knew he was gay and showed kindness when he confirmed it to her on leaving the House of Commons in 1986.

Another display of kindness was towards actor Sir Ian McKellen, who came out as gay in 1988.

In November 1990, Thatcher recommended him for a knighthood.

“It was the last thing she did as prime minister,” recalls McKellen. “I was in Paris doing Richard III and was watching TV over breakfast. They had a camera on the door in Downing Street waiting for her to come out for the final time, and at that moment the phone rang and it was No 10 saying you have a knighthood. I took that as a sign things were changing for the better.”

Last year, the late Sir Peter Morrison, Thatcher’s parliamentary private secretary in 1990, was the subject of renewed historical sexual abuse allegations concerning a children’s home in Wales.

Morrison, who was seen to be gay by several respected political commentators and whose sexuality was dubbed an open secret at Westminster, died in 1995.