As the film Philomena heads into awards season, draped with nominations for Oscars and Baftas, you might think nuns are having a bad PR moment. But then over at Team Convent, Call the Midwife is the star of BBC TV's Sunday nights with a much more sympathetic crew. Both these are fictionalised versions of real stories, and they are just the tip of the iceberg: there are large numbers of nuns in books – surely higher than their incidence in the real-life population – with nearly all the descriptions coming from women authors, though there are a few good men below. (Strangely, I made the same point about flat-sharing in books – is it something to do with women and single-sex groups?).

Muriel Spark liked her nuns – one of the main characters in The Prime of Miss Jean Brodie ends up as Sister Helena, and there is a Marxist Church of England convent in Symposium: in one splendid scene the haloes on the figures in a mural are revealed as the fur hats of Lenin and friends. The Abbess of Crewe is wholly set in a convent, but is well known to be a satire on the Watergate scandal.

And that demonstrates a key feature of convents, fictional or otherwise – they are not actually mysterious hotbeds of unknowable religious transcendence or wickedness. They are communities like any other, with secrets, dramas and troublesome elections. And so, ideal as a vehicle for a good story: any closed community is interesting (see also: country house party, boarding school), there is an opportunity to have good strong female characters without their being framed by their relationships with men, and there is always the underlying question: "Why did these women become nuns?"

Roman Catholic women of a certain age will remember being obsessed as teenagers with Kathryn Hulme's The Nun's Story, book and film – "Is God calling me to be Audrey Hepburn?" It's still a good strong read, and even more fascinating when you know the story behind it. It is a novel, but based on the life of the author's long-term companion, a former nun.

One aspect of nuns in books is that the names are confusing and you get your Sister Mary mixed up with Sister Maria – and apparently the considerable profits from The Nun's Story are languishing unclaimed because no one knows which nuns should have inherited them. More straightforwardly non-fiction are books from Karen Armstrong (Through the Narrow Gate) and Monica Baldwin (I Leap Over the Wall – so much the better name) dealing with the challenges of leaving the convent behind in, respectively, 1981 and 1949.

Of course we all like to read about nuns going off the rails: Rumer Godden's Black Narcissus is an overwrought and enjoyable look at a convent in the Himalayas, and a nun who wants a last chance. There is also the very splendid Lambs of God by the Australian author Marele Day, with its feral nuns including sheep in their community. Aldous Huxley's The Devils of Loudun (overshadowed now by the 1971 notorious-in-its-day Ken Russell film) is non-fiction, full of hysterical and demonic sisters in 17th-century France. The book very much reflects its author's non-believing, child-of-the-enlightenment stance, though it's a rattling good read, and he does his best to be fair.

Other men who have bravely written about nuns include the American novelist Ron Hansen, with his well-imagined Mariette in Ecstasy (1991), paralleling the story of St Therese of Lisieux, and Mark Salzman with Lying Awake (2000) – an extraordinary look at a nun who has visions and writes poetry, but fears both may disappear if she has treatment for epilepsy.

These have all been books with the nuns as the direct focus, but there is also a subgenre looking at them through the eyes of girls attending convent schools. In Edna O'Brien's Country Girl (1960), Cait and Baba deliberately get themselves expelled, amid some fairly unsympathetic nuns. Antonia White wrote what amounted to a misery memoir in Frost in May (1933), a lightly fictionalised version of her own experiences.

(But then it turns out her memories weren't reliable – Samantha Ellis writes rivetingly about this in her new book on literary heroines.) Much more enjoyable is Land of Spices (1941) by the under-rated Kate O'Brien – the title comes from a George Herbert poem and shouldn't be taken to imply anything exotic or cosmopolitan in the content (it means prayer) but, the relationship between Reverend Mother and a child at the convent school is engrossing. And adults get pulled in too: Iris Murdoch's The Bell (1958) is set in a religious community attached to a convent, but the nuns' role is mostly symbolic.

There are astonishing numbers of detective stories with nuns as sleuths or key characters: Antonia Fraser's 1977 Quiet as a Nun (convent, boarding school and the estimable Jemima Shore – triple threat) stands out, and the US author Jane Haddam's crime books often feature religious settings to great effect.

Once you start looking at nuns in history from a modern perspective, there comes a whole new topic – was it actually fun being a nun? Of course there must have been an unknown percentage of women closed up against their will, but it's rewarding to examine the idea that being a nun wasn't that bad an option in earlier times. In fact, dare we say it, was it the feminist choice? Look what they missed: a nun was free from the horrors and dangers of childbirth and the rigours of unwanted marriage. Often they could pursue an interest in medicine, horticulture, art or music. They didn't have to wear corsets or attract men …

This is what fascinates female authors and readers. Sarah Dunant's marvellous Sacred Hearts – published 2009, set in 1570 in Italy – looks at the idea of different choices for different women. Sylvia Townsend Warner in The Corner That Held Them (published 1948, set in an English convent in 14th-century Norfolk) gives us gossip, politics, particular friendships and details of church music.

Charlotte Brontë – daughter of the parsonage – is deeply suspicious of Roman Catholicism in general, and the figure of the nun in Villette is quite troublesome. But as s/he isn't a real nun – well, perhaps we won't examine the psychology of that too closely. She was certainly reflecting back to Gothic fiction and supernatural, creepy religious figures, rather than looking at career opportunities, and she and her heroine Lucy Snowe take a good Protestant line against Papist nonsense.

But Brontë is the exception: most authors understand more and condemn less.

Which other writers created convents worth reading about, and which books make the life sound attractive? Please offer up your thoughts …