I haven’t been to New York City’s legendary gay pride parade in more than 20 years, but I’ll never forget the two moments that got the biggest cheers. The first heralded the start of the festivities as lesbians on motorcycles — the “Dykes on Bikes” — roared down Fifth Avenue. The second came when lesbian and gay NYPD officers marched proudly in uniform as part of the Gay Officers Action League.

The sight of those officers was a “wow” moment. Not only because seeing people like us donning the uniform of a dangerous profession inspires awe. But also because it signified how much had changed between the LGBTQ community and the police, between the community and society.

This year, the organizers of New York’s pride parade have made a really bad call. They have banned GOAL from marching.

The decision came in response to understandable, long-brewing anger at the NYPD among many LGBTQ people — including growing outrage over the heavy police presence at the pride parade and concern about people of color bearing the brunt of police action. Last June in Lower Manhattan, for instance, officers pepper-sprayed participants in the Queer Liberation March for Black lives and against police brutality.

So I get the community’s anger at the NYPD. What I have trouble with is taking that anger out on LGBTQ officers. At a time when the mantra is “representation matters,” preventing officers from showing pride in who they are while in uniform is absurd. For a gut check on this, I reached out to Richie Jackson, author of “Gay Like Me: A Father Writes to His Son,” who has been involved in gay activism since the days of ACT UP. He, too, thinks the ban is wrong.

“For one thing I hate seeing us use a tactic so often used against us. Our community has no litmus test for entry and we shouldn’t start now. All are welcome — proud, shameful, closeted — all,” Jackson told me via text message. “But now we are also taking away something from LGBTQ kids. They won’t be able to see the cops marching, to see that occupation as a place for them. We’re robbing them of possibility.”

The spark for the modern LGBTQ civil rights movement was a police raid on the Stonewall Inn on a warm June night in 1969. After years of harassment at the hands of police, queer New York fought back. The New York Daily News published a sneering account of what happened, with the homophobic headline “Homo Nest Raided, Queen Bees are Stinging Mad.”

In 1981, Charles H. Cochrane Jr. became the first NYPD officer to come out as gay when he testified on behalf of a city anti-discrimination bill. He later started GOAL. Ten years later, I was standing on a patch of Fifth Avenue sidewalk watching the pride parade whoosh by. In an era when gay men and lesbians were banned from military service, seeing officers marching proudly in their uniforms was a thrill.

As I recall this, it feels as if I’m recounting ancient history. This was way before “Will & Grace” changed American attitudes, before gay-straight alliances started forming in high schools, and before children and adults began confidently coming out as transgender or nonbinary. This was before same-sex couples could legally marry. And before Pete Buttigieg made history by running for the 2020 Democratic presidential nomination with his husband at his side. He is now the secretary of transportation, the first openly LGBTQ person confirmed to the president’s Cabinet.

While America has evolved on LGBTQ issues, not everything is wonderful. Trans women of color are being murdered at alarming rates. Bigotry has taken new forms. There are still too many instances of police neither protecting nor serving LGBTQ and other marginalized communities. But the response shouldn’t be to ban LGBTQ police from a parade.

“Instead of being embraced, they’re throwing me back in the closet,” Ana Arboleda, a sergeant in the NYPD, told the New York Times. Jackson worries that banning officers such as Arboleda from marching “will just make them identify more as cops and less as LGBTQ.” That’s not good, for the police or the community.

If you’ve been to a pride parade, you know it’s a celebration of acceptance and inclusion. That’s why it’s beyond troubling that a community made up of so many who’ve been rejected by their families because of who they are is now turning on its members because of what they do for a living. This is wrong. This is shortsighted. This is a mistake.

Read more from Jonathan: