For 240 years, America has toyed with the idea of a woman becoming president. This year, for an all too brief moment, it looked as if the idea might become a reality. But the dream of a female president has remained just that, a disingenuous myth America occasionally serves up in fictions, but never permits to spill into its facts. Instead of witnessing the landmark moment of a woman moving into the Oval Office, we can now see the all-too-real misogyny that became a feature of the 2016 presidential campaign bedding down in the corridors of power. When Donald Trump called Hillary Clinton a “nasty woman” in the final debate, only a few days after a series of recordings revealed him admitting to a series of sexual aggressions and assaults, many people thought it was the end of his bid for the presidency. Instead, social media during election night revealed Trump supporters – male and female – voicing the diehard view that a woman is simply not capable of being president, too weak to stand up to foreign leaders and the military.

The sucker punch for those of us who believe that this particular woman was spectacularly more ready for the White House than her grossly underqualified and abusive opponent is that – as has historically been the case – once again, a female candidate did not carry even the female vote. A staggering 53% of white women voted against Clinton and for the man whose statements and attitudes brought misogyny, kicking and screaming, into the light.

When Clinton conceded the presidency, she tried to offer hope to the women, especially the young women, of America: “I know we have still not shattered that highest and hardest glass ceiling, but I know someday someone will, and hopefully sooner than we might think right now.” Of course, we may not think that right now, because right now the media is focusing its attention on white-male economic and racial disempowerment. It is not interested in the disempowerment of women, but that is also the story of this election, which was fought over a series of fictions, myths and outright lies.

For two solid years, the media engaged in spreading half-truths and misinformation about the first serious female candidate for president. For a few days after we learned that Trump likes to grab women “by the pussy”, the mainstream media began admitting how many of the derogatory stories swirling around Clinton were misogynistic, how many were – literally – trumped-up fictions. But then the FBI intervened, and the story reverted to its misogynistic mean, relentlessly informing the American electorate that Clinton is duplicitous, dishonest, untrustworthy. It was character assassination, and it worked.

Anyone who still believes these claims are factual – and on the evidence, some 59 million people do – should consider how closely they resemble the stories that have always been told about female politicians, both real and fictional. To do so is to realise that it is time to stop suggesting, as some commentators are doing, that Clinton failed us. The truth is, we failed her.

To understand a culture, you must know its stories. Taking a hard look at some of the tales we’ve told about the idea of a female president can teach us a great deal about this election, as well as those to come. The women who have become American presidents in the history of fiction are not quite as vanishingly scarce as they are in reality, but they’re not exactly numerous – and, until very recently, the fictions were as presumptively white as the candidates. Just 14 women have mounted a serious bid for US president, three of whom made it to a major party’s national convention, although only one secured that nomination. Five became third party candidates, and two became major party running mates, both of whom lost. We have had three female secretaries of state, one female speaker of the House. But no woman has ever been elected to the executive branch of the American government.

The idea of a woman in the White House has always prompted the same responses: it is either a joke, a disaster or a cheat. Clinton was endlessly called “Crooked Hillary” to shouts of “Lock her up”, although her crimes always varied. Had she murdered Vince Foster, or Ron Brown? Had she covered up wrongdoing in the deaths of Americans at Benghazi, stolen millions, or was she, in fact, Beelzebub? It didn’t matter. What mattered was the idea of illegitimacy.

Most stories imagine a female president who lies, cheats, murders or sleeps her way into office, or inherits the role

Our fictions about women becoming president have always worked to invalidate the very idea. Take, for example, the novel co-authored by a former speaker of the House and avowed enemy of (both) Clintons, Newt Gingrich, which tells of a woman who becomes America’s first woman president and chooses politics over national interest, resulting in a “Benghazi style attack”. Its title? Duplicity. Now Gingrich has been tipped for a cabinet appointment, because propaganda works.

In neither history nor fiction are there more than a handful of stories that imagine a female president who could ascend to the highest office in the land honestly, through merit and hard work; instead she either lies, cheats, murders or sleeps her way into office; or she inherits the role, passively, from a man. Fictional depictions of a female presidential candidate on the actual campaign trail are even rarer; this may correlate with the fact that, as Clinton herself noted, she was always more popular in office than while running. When female presidents are imagined, they are in office thanks to a fait accompli of some kind, which is also delegitimising: power was handed to her, or she inveigled her way into it. Either way, it’s crooked. Just like Hillary.

“Serious” fiction is a club into which women presidents aren’t admitted. They are segregated by genre, cropping up primarily in satire or science fiction: female presidents are a joke, or exist in an alternate reality. Women are disproportionately more likely to become president in disaster movies and post-apocalyptic scenarios, because only when large segments of the human race are eradicated do we imagine women in charge. In early science fiction tales, the apocalypse often took the form of the nullification of men, as women’s real political gains sent masculinity into an imaginary crisis from which it has not recovered.

From the first, any writing that considered the possibility of a woman president focused not on what it would mean to women, but on what it would mean to men – even when written by a woman. What seems to be the earliest fictional depiction of a female presidential candidate was a burlesque provoked by Victoria Woodhull, the first woman who ran. In 1871, Harriet Beecher Stowe published My Wife and I, narrated by a man who thinks he supports women’s rights until he meets “Audacia Dangyereyes”, who wants to be president. Her name (“damn your eyes”) says it all: she is dangerous, aggressive and ludicrous, a “crack-brained” unwomanly “creature”, “an amphibious animal”, loud and vulgar. By no coincidence, she is also accused of swindling and fraud. She singlehandedly undermined, we are told, “the whole woman movement; for the main argument for proposing it, was to introduce into politics that superior delicacy and purity, which women manifest in family life”. It was her fault if feminism didn’t take hold, because she was doing such a bad job at representing it.

That should sound familiar, because it is a very persistent trope: America pretends it is perfectly comfortable with the ideal of a female president, only to discover that it is disappointed or horrified by every human woman it encounters. Words like “tarnished” enter the story when idealised women fail to materialise. That idealised women should cleanse American politics with their purity was the view taken by Stowe’s sister, Isabella Beecher Hooker, who made the news in 1888 by predicting America would soon see a woman president, “because the men would vote for her out of pure gallantry and chivalry”. That’s not quite how it played out. American women wouldn’t even get the vote until 1920, when the 19th amendment was ratified. Newspapers instantly produced satirical visions of women marching into the White House. One imagined the inauguration of the first woman president: “It will be a woman’s parade … at this Waterloo of Pants place aux femmes!” One can only imagine what the author would have made of Clinton’s pantsuits.

Margaret Chase Smith, the first woman elected to the Senate who had not inherited the seat from a man. Photograph: Bettmann Archive

Four years later, the first fictional female president seems to have arrived, in a 1924 silent film called The Last Man on Earth. Based loosely on Mary Shelley’s 1826 novel The Last Man, it takes place between 1924 and 1950, as America is hit by a plague of “masculitis”, which leaves adult men sterile. By 1950, a woman has become “presidentress” (her enemy, prophetically, leads “the Tea House Gang”). In “a world dominated altogether by women”, the presidentress needs to find the last man on earth to continue the human race. The anxieties about women taking power from men are transparent: this “manless world” prompted newspaper headlines such as “He-Man Type of Girls Rule in Film of Future”.

As American culture began worrying less about women’s purity and more about their growing political and economic power, fictions responded by imagining idealised female presidents in terms of passivity and pacifism. In 1931, a play called A Woman of Destiny featured a widow named Constance Goodwin who became president. Six years later, the play was turned into a novel set in the near future of 1943, and seems to have been the first portrayal of an actual female president serving in a realistic, contemporary setting. It was also the first of a long line of stories to imagine a woman who inherited the White House only when a male president dropped dead, and who leaves presidential duties because she has “more important” things to do – namely, be a grandmother.

As women made historic gains, stories began dealing with how 'Mrs President' could balance leadership with motherhood

In 1932, a book by Charles Eliot Blanchard called A New Day Dawns imagined American history as told in 2162, a story focusing on “the tremendous struggle of 1962”, in which a woman was elected president and ushered in a new era of altruism. This may sound encouraging, but Jane B Stanton, an imaginary descendant of the feminist Elizabeth Cady Stanton, was a eugenicist, instituting a passive aggressive totalitarianism that relies on sterilisation to create a “perfect” – and profoundly racist – society.

As real American women continued making historic gains, the question of male power and prerogatives became paramount. Stories began dealing explicitly with how a putative female president (“Mrs President”) could possibly balance leading the free world with motherhood. (A female candidate who didn’t have a family was unimaginable: single or gay women were not permitted into national fantasies.) In 1948 Margaret Chase Smith became the first woman elected to the Senate who had not inherited the seat from a man. A year later a musical called As the Girls Go appeared on Broadway; it was originally titled The First Gentleman of the Land, and its producer reportedly checked with a lawyer “on the constitutionality of a lady’s being elected to the White House”. Because how could a woman president be legitimate? Set in 1953, four years into the future, it is a comedy about the “First Husband”, who enjoys leering at the pretty girls he encounters and occasions jokes about gender role reversals that even reviewers in 1949 found unfunny.

A less silly depiction came in the 1952 novel The Dark Mare – conflating “dark horse” and “nightmare”. Another contemporary story, Damsey Wilson’s novel tells of the presidency of Miriam Hall Bradley. Again there is a great deal of anxiety about “the dubious title of – First Husband”; Mr Bradley complains that his wife is “goofy on feminism”, and much of the plot concerns whether he will leave her for a woman who isn’t busy leading the free world. Project Moonbase (1953) is frequently credited (incorrectly) as the first film to depict a female president, but it may be the first science fiction tale in which the female president is a minor character, both taking for granted and marginalising the idea.

When Margaret Chase Smith made an unsuccessful 1964 bid for the Republican nomination, the journalist Russell Baker wrote: “Washington’s political chinstrokers give Senator Margaret Chase Smith little chance to become president this year – and in any case, since Mrs Smith is a widow, the First Gentleman problem would not arise.” A film made that same year, Kisses for My President, focused entirely on the “First Gentleman problem”: its strapline was “When a woman becomes president of the US, what happens to her poor husband when he becomes the ‘First Lady’?” The film opens with Leslie Harrison McCloud (Polly Bergen) being sworn in, while the camera captures her husband’s peevish expression. The eventual happy ending is his, not hers: Mrs McCloud gets pregnant and resigns, as his virility triumphs.

Gradually, however, women like Clinton, Geraldine Ferraro and Sarah Palin began to inch nearer. In 1972, congresswoman Shirley Chisholm became the first African American woman to run for president. As these real women got closer to the White House, our fictions accelerated correspondingly. Science fiction, in particular, always interested in finding imaginary ways to test cultural and political waters, began portraying an increasing number of female presidents (many of whom were also non-white). There was President Juanita Alvarez in Sunstorm (2005) by Arthur C Clarke and Stephen Baxter, and President Helen Lasker in Carl Sagan’s Contact (1985). Female presidents in apocalyptic disaster movies tend not to survive the story: President Janice Castleman in KA Applegate’s Remnants (2001) is wiped out along with everyone else on earth. Robert J Sawyer’s Red Planet Blues (2013) features a female president whose brain survives her assassination and is uploaded into an artificial body, which sounds like the kinds of things Hillary Clinton was accused of (her charges included using body doubles).

‘Her best hope was to be disliked and crooked, but at least she’d be president’ … Julia Louis-Dreyfus in Veep. Photograph: HBO

In fact, fictional women presidents were unlikely to last much longer in the field than their historical counterparts. Patty Duke played President Julia Mansfield in the television satire Hail to the Chief (1985), which lasted all of seven episodes; her plotlines still involved contending with a philandering husband and problem children. By 2008, Geena Davis was the vice president who succeeded a president who died of an aneurysm in Commander in Chief; it too focused on the efforts of the president to balance her personal and professional life, running to all of 18 episodes. State of Affairs, with Alfre Woodard as the first female black president, lasted 13 episodes. The series 24 recently managed a white woman president after an African American man for two whole seasons, until she resigned over the ethical compromises she’d made. Similarly, Selina Meyer became president for two seasons of Veep when the president resigned, before being replaced by another woman president. Selina’s incompetence is a large focus of the comedy, although the show also directs much satirical firepower at lingering misogynistic tropes. In the last season, Selina tells her daughter about the moment of her political awakening, when her father said to her, “You know, a lot of people don’t like Nixon, but by God, they respect him. And that’s you, peanut.” It sounded prophetic to many of us: her best hope was to be disliked and crooked, but at least she’d be president.

It didn’t turn out that way. Republicans so successfully attacked Clinton’s legitimacy, and that of the “establishment” she supposedly represented despite being the first female major-party candidate in the 240-year history of the United States of America, that they invalidated her bid. A woman who’d withstood decades of misogynistic abuse could not conquer an unashamed misogynist; the “nasty woman” who devoted her life to public service could not overcome the rich bully who decided to pick up politics on a whim. Along with the validity of Clinton’s actual campaign went, many fear, the very idea of a female president for at least another generation. It will remain at best a fiction, a mendacious myth, while reality has gone beyond satire. It turns out that even an apocalypse is not enough to make a woman president.