I have always enjoyed a really dirty book. As a child, I loved the sensual thrill you could get from reading – before I was old enough for books with sex in them, I would read food scenes again and again. At school, people practised kissing and looked at each other’s knickers. I wondered why no one in my books did things like this. They had midnight feasts, but no midnight assignations. Some children believe their toys come to life when they are asleep. I hoped that the Famous Five characters were secretly getting off with one another when the pages were closed. What were they doing? I wanted it to be more exciting than what I had already encountered in the playground – literature is supposed to broaden one’s horizons after all – but had no idea what this would mean.

It was 1982. Christian Grey did not exist. To enlighten me, along came a collection of progressive, no-holds-barred sex-education books from Compendium Books, Camden, in north london. Previously, I had suspected the Famous Five of things like showing their bums to pirates. “Have you ever put a pillow between your legs and squeezed it?” asked The Playbook for Kids about Sex. Was this what other children were doing? Was this what George and Anne were doing? I didn’t know what to think. I was 10, and already felt twee and repressed. Damp‑looking pages from pornographic magazines would sometimes flutter sadly past the gates of my primary school, but I was not allowed to touch them. I wanted to know as much as I could about life, but felt that the important details were being kept from me.

Facebook Twitter Pinterest Judy Blume’s works ‘carried the faint antiseptic tang of Sex Education’. Photograph: Linda Nylind/Guardian

My local library provided me with the works of Judy Blume, including Forever, which, despite including a penis called Ralph, carried the faint antiseptic tang of Sex Education. When a teacher explained to my class how “bawdy” Chaucer was, we stupidly didn’t believe her. Anything allowed at school could not be really sexual, and so I missed out on the pleasures of “The Miller’s Tale”, and the delightfully disgusting Fanny Hill. But we were a fairly small 5th form in possession of one well-thumbed copy of Sidney Sheldon’s If Tomorrow Comes. English literature could wait.

Next came the increasingly predictable thrills of Jackie Collins and the high-class porn of Jilly Cooper. And Lace by Shirley Conran (“Which one of you bitches is my mother?”). But these books felt empty. There was “throbbing arousal” and sometimes “hard thrusting”. There were occasionally goldfish. But the women in these books were always having nervous breakdowns and abortions and almost dying. My A-level texts were more complex, but not one featured sex – unless you counted The Color Purple, which, unfortunately, was presented in terms of its “issues”. I enjoyed Lucy Irvine’s Runaway and Marge Piercy’s Woman on the Edge of Time and similar “edgy” feminist novels. But the only graphic sex you were likely to get in them were the rape scenes. When a university friend recommended Nancy Friday I was relieved. Her collections of no-nonsense, properly rude women’s sexual fantasies were my bedside reading for a long time. But it didn’t feel like real literature.

Then, at last, I encountered Nicola Six. It all started when someone at a party said I reminded him of her. I think he meant it as a compliment, or at least an inventive come-on. Fascinated, I sought out London Fields by Martin Amis, in which she was the anti-heroine. Here was properly dirty fiction. Dirty in every sense, and without (I discover now, flicking through a very well-thumbed copy) even having much standard PIV sex in it. With its free-indirect-discourse riffs on sodomy in literature, underwear, bikinis and even weather, it was titillating in quite a new way. The sentences themselves oozed spunk. I wanted to write like that, but had no idea how. And I wanted to read more of this sort of fiction, in which complex sensual pleasure came from the writing itself, in which even a description of a bunch of flowers becomes dirty: “The colours spoke to her of custard, of blancmange – a leaden meat tea served on pastel plates, the desiccation of a proletarian wake for some tyrant grandad, or some pub parrot of a granny, mad for these thirty years.”

There is a finger-wagging part of the zeitgeist that quietly warns women to be careful when writing about sex

Male writers were definitely the ones to go to for sex, I soon realised. There were women writing the kinds of sentences I loved – Zadie Smith, Nicola Barker and Arundhati Roy. But it seemed that with male writers, the more establishment the figure, the more prizes he had won, the older and more assured he was, the dirtier the book was going to be. Of course, no sensible person reads The Dying Animal by Philip Roth only for the sex. The book is much more important than that. On the surface, it presents a man’s obsession with his younger lover’s body; underneath, it is about human frailty, ageing and death. “Normally you see the vagina and you can open it with your hands, but in her case it bloomed open, the cunt emerging from its hiding place,” writes Roth. The novel freely gives its pleasures as well as exploring pain.

David Lodge manages to get two versions of the same detailed spanking scene – complete with “rosy buttocks” – into his novel Deaf Sentence, and the trick is that the scene doesn’t even take place outside the imaginations of the characters. I am still considering how one might teach creative writing students why this is literature and EL James’s spanking scenes are not. Of course, in one way the answer is obvious: Lodge deals in reality; James with fantasy. Lodge helps us to better understand our world; James provides easy pleasure. Lodge is writing serious fiction; James, erotica. Most people might guess that erotica is defined by being more explicit, but this isn’t true. Perhaps in this seminar – which would require one of those end-of-term bottles of cheap wine even to be able to contemplate – we might try to identify the source of passages such as this: “One night when she was stretched out beneath me on the bed, passively supine, waiting to have me separate her legs and slide in, I instead shoved a couple of pillows back of her head, propped up her head like that, angled it like that up against the headboard, and with my knees planted to either side of her and my ass centred over her, I leaned into her face and rhythmically, without letup, I fucked her mouth.” The Dying Animal again. It’s oddly beautiful, dirty, far ruder than Grey. It is one of many works that inspired my latest novel: The Seed Collectors is about, among other things, reproduction, inheritance, family and botany. In other words, sex. I wrote the book partly because I wanted to think about the effects that our sensual pleasures have on our lives. The book is also supposed to be funny, authentic and, ultimately, tragic.

Facebook Twitter Pinterest Ben Kingsley and Penélope Cruz in a still from Elegy (2008), the film adaptation of Philip Roth’s The Dying Animal. Photograph: S Goldwyn/Everett/Rex Features

So I was extremely surprised recently when my US agent forwarded me a rejection note in which an editor wonders whether I intended it as “erotica”. I have always included sex in my books, but no one has ever really mentioned it before. This one has a masturbation scene that takes place in a train toilet and a massage scene that goes a bit far. But erotica? No. Surely it couldn’t be that while it is possible for a man to write a whole book about masturbation (Roth yet again) and be regarded as an important writer, a woman can’t even attempt one such scene without being shoved on to the same shelf as Fifty Shades of Grey and Black Lace Quickies? Perhaps Amis was right when he wrote that “masturbation was an open secret until you were 30. Then it was a closed secret.”

But a quick flick through recent Bad Sex award nominations reveals that women – including those over the age of 30 – are just as likely as men to write of “lapping” and “wetness”. It’s not that women don’t write about sex. It’s not that simple. But something in the air – that finger-wagging part of the zeitgeist – quietly warns us to be careful. Men can go out after dark but we can’t. They can go topless but we can’t. They can write about blooming vaginas and have naked ladies on their book covers and we can’t. They can be properly dirty and we can’t. Not if we want to be taken seriously. Perhaps this was why I had not found really explicit sex in the works of the female writers I most liked. (Yes,I do remember Barker’s plastic centipede in Five Miles from Outer Hope, but I don’t think that counts.)

Grey review – EL James revisits her tawdry S&M saga Read more

Julian Barnes’s The Sense of an Ending, which includes on its first page the images of a “shiny inner wrist” (from a man masturbating his girlfriend) and semen swirling in a plughole, is partly about what happens when a middle-aged woman sleeps with her daughter’s boyfriend. A similar scenario is presented in Helen Walsh’s novel The Lemon Grove. Barnes is without doubt the better writer, but both books are accomplished. While The Sense of an Ending won the Man Booker prize, Walsh’s novel is dismissed on Amazon as “soft, badly written porn” which includes – horrors – “the c word”. One reviewer complains that the 17-year-old lover is “a child”.

It would be simple to conclude that men have it easier than women and can write what they like. But I’m not sure that’s completely true. Whole theses have been written about the supposed misogyny in Roth or Amis, which may seem more dignified than being one-starred on Amazon by someone who can’t even spell, but probably still hurts. But perhaps because so many more people are now able to publicly review books, share their opinions and generally pour scorn on one another, all writers have become increasingly nervous. In the last few years I have noticed that students are more reluctant to explore real desire in their work. (Erections are increasingly rare in creative writing workshops.) I hate to think that any young male poets have been put off writing honestly about sex because of the silly outcry over Craig Raine’s lovely poem “Gatwick”. Will I think again next time I write a train sex scene in case someone else calls it erotica? I hope not.

• The Seed Collectors by Scarlett Thomas (Canongate Books, £14.99). To order a copy for £11.99, go to bookshop.theguardian.com or call 0330 333 6846. Free UK p&p over £10, online orders only. Phone orders min. p&p of £1.99.