It’s hard to know how we got here, but let me have a go. Five years ago, Nicola Sturgeon led Scotland’s largest ever Pride event. “Choose love” said her T-shirt in vivid LGBT+ rainbow colours. And around her: rainbow, rainbow, rainbow. This week: Holyrood bans rainbow lanyards. What happened?

The official explanation, delivered by the MSP Claire Baker, who sits on the parliament’s corporate body, was that the decision will help minimise the risk of perceived bias. From now on, parliamentary staff must only wear an official Holyrood purple lanyard and must remove pins and badges showing support for social movements or campaigns.

Maggie Chapman of the Scottish Greens, who are very keen on rainbows, said the parliament’s decision was regressive and sent the wrong signal to staff and visitors. The rainbow symbol, she said, was a gesture of self-expression and an inclusive workplace and she urged the parliamentary authorities to think again.

But thanks to a political mess largely of their own making (cheered on by the Greens), the authorities at Holyrood had no choice. Ms Chapman says the rainbow symbol is about an “inclusive workplace” but “inclusive” is precisely the wrong word.The rainbow flag has inspiring beginnings, in the campaign for gay equality led by the great Harvey Milk, and it was explicitly created to include gay people in public life on an equal footing. But increasingly the flag has started to feel exclusionary. It has been blown off course.

I’ve seen it for myself. I was at Edinburgh University last year when a large group of protesters, rainbow flags held high, blockaded a lecture hall to prevent an audience from getting in to see the documentary about trans rights Adult Human Female. Many of the men and women trying to see the film were gay, and yet somehow they’d found themselves being jeered at by protesters holding rainbow flags.

A similar thing happened again more recently and was the catalyst for the lanyard ban. A woman turned up for an event at Holyrood and was told she would have to remove a badge she was wearing that said “Scottish Lesbians”, the name of one of the groups that has campaigned on the trans debate from a gender-critical perspective. The key to the story is that she was then checked into the parliament by someone wearing a rainbow lanyard.

The hypocrisy of this is obvious and is clearly the reason the authorities at Holyrood have made their decision on a ban. If you’re going to have a policy on symbols/patterns/logos, either you allow everything or you allow nothing. You have to be consistent and banning a “Scottish Lesbians” badge and allowing the LGBT rainbow is self-evidently inconsistent.

Read more: Mark Smith: A ban on the LGBT rainbow: how did Scotland get here?

Read more: Police ‘Hate Monster’ - What is Holyrood's problem with lesbians?

There are also deeper, sadder reasons for how we got to this point. Ten years ago or so, the rainbow flag would have been seen as a pretty universally positive symbol, especially for gay people. You’d see it at gay events, in gay bars, and so on, and most, if not all, gay people would have happily accepted it as something that represented them, the campaign for equality and its inspiring history. Count us in guys.

Not anymore. In the last decade or so, something’s changed. The rainbow flag has become more explicitly linked to the campaign for gender self-ID, and as the campaign has intensified and become more controversial, so gay men and women who are opposed to self-ID, or are concerned about the effects on women-only spaces, or have other worries about the direction of travel have become increasingly alienated from the flag.

This is why Ms Chapman, and others at the parliament who wish to wear the rainbow lanyard, are specifically wrong to say it is inclusive. Many visitors and staff at Holyrood may feel comforted and supported by the sight of the rainbow and that’s fine, and positive. Many people will also wear the rainbow lanyard because they want to do the right thing and wish to be seen as supportive. All of that comes from a good place and is welcome.

But the rainbow is no longer what it was, which is perhaps the fate of all flags in the end. It has come to be seen as representative of one side of the debate on trans issues and not all LGBT people are on that side. How, for instance, is a lesbian who believes a biological man cannot self-identify as a lesbian expected to feel about the flag? How is she expected to feel when staff in rainbow lanyards ask her to remove a badge that says “Scottish lesbians”? If you believe lesbian means same-sex attracted female, you may also have started to believe that the rainbow flag is no longer for you.

I have to say, it’s weird, and sad, that we’ve got to this point but here we are. For years, the SNP suggested, based partly on their support for LGBT rights, that its values were more progressive than those of the Tories, or the UK, or Westminster, and yet at Westminster, staff are still free to wear their rainbow lanyards and Scotland’s parliament has introduced a ban. So who exactly is more progressive now?

The MSP Jamie Greene, of Holyrood's LGBT group, probably put it best when he said the rainbow lanyards had become part of the battle over identity politics and that an attempt to please everyone ended up pleasing no one. The Scottish Greens say the ban is regressive, but in a significant way it’s progress. At least now we can be more honest about what’s happened to the rainbow. At least now we can admit it’s no longer for everyone, if it ever was. And at least now we can be more honest about where identity politics has taken us.