The American right presents homosexuality as something alien to the American experience – an intruder that inexplicably gate-crashed America in 1969 in the form of a rioting drag queen clutching a high heel in her fist as a weapon. The statements of Michele Bachmann, Rick Santorum, or Mitt Romney insistently hint that the fag does not belong under the flag. But there's something odd here. For people who talk incessantly about honouring American history, they have built a historical picture of their country that can only be sustained by scrubbing it clean of a significant part of the population and everything they brought to the party (if not the Tea Party).

In his new book, A Queer History of the United States, the cultural critic Michael Bronski runs the film backward, through 500 years of American life, showing there were gays and bisexuals in every scene, making and remaking America. They were among some of the country's great icons, from Emily Dickinson to Calamity Jane to perhaps even Abraham Lincoln and Eleanor Roosevelt.

The rioting drag queens of the Stonewall Inn arrive only on page 210 of a 250-page book that argues gay people weren't merely present at every stage – they had a historical mission in America. It was to expose Puritanism, scolding and sexual intolerance. Yet in a strange and disagreeable turn, Bronski concludes that in the final act of this story, gays have en masse abandoned their mission by demanding the most domestic and Puritan goal of all: monogamous marriage.

The gay alternative to Puritan America began before the first white settler ever arrived. The day before Christopher Columbus set foot in North America, it was a safer place for gay people than it was ever going to be again for several centuries.

The limited-but-sturdy evidence provided by historians that Bronski draws on suggests homosexuality was treated matter-of-factly among most Native American tribes. In the records of the Lewis and Clark expeditions, Nicholas Biddle observes: "Among the Mamitarees, if a boy shows any symptoms of effeminacy or girlish inclinations he is put among the girls, dressed in their way, brought up with them, and sometimes married to men."

Among the Crow tribe, a horrified white observer wrote, "men who dressed as women and specialised in women's work were accepted and sometimes honoured; a woman who led men in battle and had four wives was a respected chief". This shouldn't be entirely romanticised. One tribe "accepted" homosexuality by raising young men to be "passives", available as "sexual resources" to the tribe, which sounds uncomfortably close to rape. But in most places, different sexualities were granted room for expression, much of it consensual.

The Europeans looked on in revulsion, like Jerry Falwell in a powdered wig. In the 1775 diary of Pedro Font, a Franciscan on a trip to what is now California, he warns that "the sin of sodomy prevails more among [the Miami] than in any other nation" and concludes with a cluck: "There will be much to do when the Holy Faith and the Christian religion are established among them."

There was a lot to do and it was done with extreme violence. These practices were stamped out by force, which Bronski notes "provided a template for how mainstream European culture would treat LGBT people throughout much of US history".

Pansexuality: What does it mean and how is it different from being bisexual?

The Europeans who arrived in North America had a ferociously fierce sense of how gender and sexuality should be expressed. They had fled Britain because they felt it had become a syphilitic brothel. Although homosexuality was illegal in Elizabethan England, the culture allowed it to be represented and discussed. Christopher Marlow could even go around semi-publicly saying: "St John the Baptist was bedfellow to Christ and leaned always in his bosom, that he used him as the sinners of Sodom."

The Puritans came to America to shun all this, and to build instead a pure theocratic homeland. As the research of historian Jonathan Ned Katz shows, they meant it: many people were executed for sodomy. Yet he also uncovered cases that suggest this isn't the whole story. Look at the court records of a man called Nicholas Sension of Windsor, Connecticut, for example. From the 1640s to 1677, he had a long history of propositioning men for sex, offering to pay men for sex and sexually assaulting male servants. He was admonished by the town elders in the late 1640s and in the 1660s, but there was a general consensus against legal charges. They liked him. The prohibition, it seems, wasn't absolute. But then, in 1677, he was convicted of attempted sodomy, publicly whipped and had his estate seized.

From the start, there were Americans who dissented from the Puritanism – often in the most blatant way. In 1624, a large group of people led by a man named Thomas Morton decided to found a town based on very different principles, in an area that is now Quincy, near Boston. They called the town Merrymount – popular slang at the time for illicit forms of sex – and built an 80ft phallic symbol in the town centre. They freed any indentured servants who joined them, befriended the local Native American tribe and began to intermarry with them, suggesting many of their members were heterosexuals sick of Puritan strictures and open to other ways.

Merrymount sounds as quintessentially American as Salem – and a lot more fun. But the conflict that runs through American history – between fundamentalism and sexual freedom – mowed down Merrymount. In 1629, after a five-year-long prefiguring of life in South Beach or West Hollywood, the local Puritans invaded the town and dismantled it brick by brick. (History doesn't record what they did with the phallus.) Morton was deported back to London, where he became one of the most eloquent critics of the genocide of the Native Americans in Europe.

The Puritan spirit was soon diluted by a flood of new immigrants who weren't drawn by their religious vision, but by economic opportunities. Between 1700 and 1720, the population almost doubled to 470,000. But it remained a fiercely sexually repressed society. In 1775 a young woman called Jemima Wilkinson had a chronic fever and announced that Jesus Christ had entered her body and stopped her from being a woman. She should no longer be called male or female; she was now neuter. She travelled across America raging against sexuality of any kind and saying nobody should ever have sex again. Crows would gather and cheer her with a mixture of glee and guilt. A huge cult of anti-sex surrounded her.

Some gay people were rebelling in more inventive ways. In 1782, at the age of 22, Deborah Sampson Gannett dressed as a man and enrolled in the army as Robert Shurtliff. (Read that surname again.) She fought bravely in several battles, until she was wounded and exposed. Her memoirs became a bestseller, including her titillating accounts of flirting with women (and hinting at more).

Again, there are hints that America at that time was more open to alternative sexualities than we have been led to believe. She sparked a popular genre that ran through the American Civil War of tales of disguised women who fought in battle. Some were even awarded military pensions.

Yet here's a strange wrinkle. The ideas of the Enlightenment were at the core of America's founding, yet they didn't percolate into its view of sexuality until far later. In France, the implications of Enlightenment values for gays were obvious almost immediately. In 1789, the French National Assembly declared that "liberty consists in the freedom to do everything which injures no one else" and abolished all punishments for sodomy two years later. The United States kept, elaborated on and enforced its sodomy laws for another 212 years. Why?

The historian RI Moore has tried to unpack how societies create "dangerous" groups that need to be shunned – Jews, heretics, lepers, gays – in his book The Formation of a Persecuting Society, and Bronski subscribes to his perspective. Nothing helps to solidify a group, and to make its members feel they belong, more than identifying an enemy, or somebody who has to be expelled from the tribe. To have Us, you need to have Them. Perhaps precisely because America was admirably a country of immigrants, it needed to cling to the embers of Puritan homophobia to reinforce a sense of unity.

It was only in 1869 that the Hungarian writer Karl-Maria Kertbeny coined the word "homosexual" and began to try to describe the phenomenon scientifically. But as Bronski tells it, the real break in the American conversation about gays came from a source that is often overlooked, the anarchists of the late 19th and early 20th centuries. (Please, nobody tell Glenn Beck, or we'll have a flow chart showing that gay marriage ineluctably leads to anarchy, which ineluctably leads to George Soros.)

Writers like Alexander Berkman and Emma Goldman were the first to put forward three crucial points that transformed the debate. Bronski celebrates their challenge to narrowly constrained domesticity: "They argue that sexuality is natural and positive, that sex can be solely about pleasure, and, if consensual, should not be the subject of any laws." In their suspicion of all rules and all laws, they were the first to see the nasty codes surrounding sexuality served no positive purpose and only spread misery. Intriguingly, the first great open champions of homosexual freedom in America were, as it turns out, almost all heterosexual.

It's around this same time that gay people began crafting their own narratives, albeit awkwardly and painfully, for the first time in the American story.

A leading neurologist in 1894 wrote down these words of one of his patients: "The knowledge that I am so unlike others makes me very miserable. I form no acquaintances out of business, keep mostly to myself, and do not indulge my sexual feelings." The scattered, and still furtive, confessions and reflections of gays as a new century approached ache with this sense of pure isolation. Many of them believed they were the only homosexual in the world – a human dead-end.

But when gay people began to be able to whisper, they began to find each other. Bronski pores over the letters pages of magazines like Physique Pictoral, which starting in 1951 depicted bodybuilders in small posing pouches. The letters whisper ever louder: "I know that I am not alone in my beliefs" and "you are truly doing a wonderful job in uniting young men from all over the world who share a common interest".

A series of historical trends were colliding to make steps towards gay equality possible. For the first time, it was becoming normal for single adults to live alone, apart from their family unit. The apartment, the car and the city: all made anonymity possible and with anonymity there came the flickers of freedom. Then, in 1960, a small white tablet turbo-charged the cause of gay equality. The contraceptive pill separated sex and reproduction for heterosexuals, so that for them, sex became what it had always been for homosexuals – a joyous and exuberant end in itself. Straight people were no longer so inclined to tut – they were doing it themselves. The gradual expansion and freeing of straight sexuality – its de-Puritanisation – brought with it greater tolerance for gay sexuality, as the two converged.

But the most decisive turning point arrived when gay people began to band together to demand to be treated decently. The Mattachine Society was founded in 1950, named after a French Renaissance secret fraternity of unmarried men. But it couldn't agree on its central goal. The battle in that society – which created a deep split in the group within three years – runs through gay history from that point on and eventually breaks apart Bronski's book. It boils down to this. Is the point of the gay struggle to say we are essentially the same as straight people, or is it to say we are different and glad to be so?

My view – since reading Andrew Sullivan's masterpiece Virtually Normal when I was a teenager – is that the point of the gay-rights struggle is to show that homosexuality is a trivial and meaningless difference. Gay people want what straight people want. I am the same as my heterosexual siblings in all meaningful ways, so I should be treated the same under the law, and accorded all public rights and responsibilities. The ultimate goal of the gay-rights movement is to make homosexuality as uninteresting – and unworthy of comment – as left-handedness.

That's not Bronski's view. As he has made more stridently clear in his previous books, he believes that gay people are essentially different from straight people. Why is his book called a "Queer History" and not a "Gay History"? It seems to be because the word "queer" is more marginal, more edgy, more challenging to ordinary Americans.

He believes that while the persecution in this 500-year history was bad, the marginality was not. Gay people are marginal not because of persecution but because they have a historical cause – to challenge "how gender and sexuality are viewed in normative culture".

Their role is to show that monogamy, and gender boundaries and ideas like marriage throttle the free libidinal impulses of humanity. So instead of arguing for the right to get married, gay people should have been arguing for the abolition of marriage, monogamy and much more besides. " 'Just like you' is not what all Americans want," Bronski writes. "Historically, 'just like you' is the great American lie."

He swipes at the movement for gay marriage and Sullivan in particular, as an elaborate revival of the old social-purity movements – with the kicker that gays are doing it to themselves. (It's easy to forget that when Sullivan first made the case for gay marriage, his events were picketed by gay people spitting this argument into his face.)

When Bronski argues this case, his prose – which is normally clear – becomes oddly murky and awkward, and he may not agree with every word of my summary. This is the best I can figure out his position: He does finally explicitly say that the gay movement should have fought instead to "eliminate" all concept of marriage under the law, a cause that would have kept gay people marginalised for centuries, if not forever. Of course some gay people hold revolutionary views against the social structures of marriage and the family – and so do some straight people. But they are small minorities in both groups. If you want to set yourself against these trends in the culture, that's fine – we can have an interesting intellectual debate about it. Just don't equate it with your homosexuality.

When Bronski suggests that gay marriage "works against another unrealized American ideal: individual freedom and autonomy", he is bizarrely missing the point. Nobody is saying gay people have to get married – only that it should be a legal option if they want it. If you disagree with marriage, don't get married. Whose freedom does that restrict?

It's bizarre that Bronski – after a rousing historical rebuttal to the right-wing attempt to write gays out of American history – ends up agreeing with Santorum, Beck and Bachmann that gay people are inherently subversive and revolutionary, longing for the basic institutions of the heterosexual world to be torn down.

There's a whole Gay Pride parade of people marching through Bronski's book who show it isn't so. I can see them marching now, down the centre of the Mall: the Native American chief with her four wives, Nicholas Sension with the whip marks on his back, the residents of Merrymount holding aloft their their 80ft phallus, Deborah Sampson Gannett dressed in her military uniform as Robert Shurtliff and the men from Physique Pictoral in their posing pouches, amazed to discover they are not alone.