John Bayley with Iris Murdoch in 1997: they shared an interest in the moral purposes of fiction. Photograph: Rob Judges/Rex

John Bayley, who has died aged 89, was an astute and influential literary critic. He was the first holder of the Warton chair in English literature at Oxford University, and one of the best-loved and most inspiring of Oxford’s teachers.

He was also a minor novelist, whose works were eclipsed by the great roster of outstanding novels written by his first wife, Iris Murdoch. Later in life he achieved unexpected fame after the first in his trilogy of memoirs about life with Murdoch, Iris: A Memoir (1998), became a bestseller and was made into a film, Iris (2001), starring Kate Winslet, Judi Dench and Jim Broadbent.

He married Murdoch, then a philosophy fellow at St Anne’s College, Oxford, in 1956. Bayley was an English tutor at New College at the time. Her second novel, The Flight from the Enchanter, appeared the same year, setting her well on her way to being England’s most distinguished postwar female novelist. This pair of young, donnish authors cut a dash in Oxford – one enhanced by her flashy green motor car. But it was to academic literary criticism that Bayley turned. His writing from then until after his retirement from the Warton chair in 1992 would build his reputation as a great theorist of fiction.

The couple shared an interest in the moral purposes of fiction, the idea of the novel as teacher of the “otherness of the other person”, an inculcator of goodness and love. This aesthetic-moral vision was at the core of their lifelong devotion to each other – buttressed rather than otherwise by a heady liberalism allowing her a sequence of relationships on the side (never, of course, with anybody less than the most distinguished of European intellectuals).

While she filled her novels full of the sexual complexities she enjoyed, he produced a series of critical studies, beginning with the classic theorising of The Characters of Love (1960), going on to exemplary studies of Tolstoy (1968), Pushkin (1971), Hardy (1978) and The Short Story (1988).

For Bayley, as for Murdoch, the great exponent of fiction’s trade in goodness and the morality of persons was Shakespeare, and his many encounters with Shakespeare are among the best there have been. His Shakespeare and Tragedy (1981) still stimulates students.

Bayley’s first critical book, The Romantic Survival (1957), set out his influential take on the nature of poetic reality. It opens with Kipling’s hostility to those equating poetry with Golden Age nostalgias and aloofness from what happens “here and now, in the factory, and the grey atmosphere of modern England”. For Bayley, poetry would be in the best sense banal, as banal as Kipling, as common and vulgar as Keats – as he put it in a lecture for the British Academy in 1962.

Jim Broadbent as John Bayley, with Judi Dench as Iris Murdoch in Iris, the 2001 film of his memoir. Photograph: Moviestore Collection/Rex

He was unrivalled in his appreciation for the way the authors he loved were entangled in “the banality of the here and now”. He loved the detail in a novel – how aeroplanes worked, what a pocket battleship was, what Kipling meant by a “cheap Beheea sugar-crusher”, where to buy a good cloth cap. He also relished a critical fight, particularly with the structuralist and poststructuralist fashions of the 1970s and 80s. (Some of his best encounters with the proponents of postmodern theory are collected in The Order of Battle at Trafalgar, 1987.)

His sturdy interest in common readers was at odds with his own background, and the mannerisms and get-up he adopted, which were those of an eccentric English gent (the ruined kit from second-hand shops that only the truly affluent can get away with sporting). On their many British Council trips abroad, the professor and his novelist wife performed a literary double act that was often misread as a whimsical throwback to early imperialist times.

Bayley always enjoyed casting himself in the role of the holy fool, dumped bemusedly amid the dangerous courses of the world. In his first novel, In Another Country (1955), about British intelligence officers in and around occupied Cologne getting into trouble by general rule-breaking and piss-taking, he appeared as the soldierly innocent abroad, the officer with the stutter producing chaos on the parade ground. The stutter remained usefully on call all his life, helping greatly in his dedication to an appearance of agreeable buffoonery. Under that mask a far steelier person could pursue his own way.

Born in Lahore, India, Bayley was the son of a major in the Grenadier Guards, FJ Bayley: a child of the Raj who would all his life celebrate the peculiar greatness of the Raj’s greatest writer, Rudyard Kipling. Unlike Kipling, he flourished in the English private-school system. At Eton, where he became an Oppidan scholar, he came on immensely as a young historian and litterateur. Before leaving school in 1943 he was awarded a clutch of prizes. He also won a scholarship to read history at New College, Oxford but, the second world war then being in full swing, he went straight into his father’s regiment, serving until 1947.

When he at last entered New College that year, it was to read not history but English, under the tutelage of Lord David Cecil – who was well up Bayley’s gentlemanly street. They became great friends and eventually colleagues. Bayley’s Oxford studies were even more glitteringly successful than his school ones. In 1950 he was awarded a first, and also won the Chancellor’s English essay prize, and the coveted Newdigate prize for poetry. Bayley never finished anything so mundane as a thesis – much too Germanic, American or, worse, scientific for the Oxford humanities in that era. In 1951 he received a postgraduate scholarship to Magdalen College, was briefly associated with the new St Antony’s College for graduate students, and in 1954 was elected English fellow at New College.

By this time, Cecil had risen to be Goldsmith’s professor of English at Oxford, and the poet (and one-time prisoner of war) John Buxton had arrived to replace him as tutor. With Bayley in support, they would make English studies at New College a formidable thing. The classes in the reading of poetry that Bayley offered for years with Cecil – that stutter well to the fore – became legendary, as well as being an apt allegory of the old Oxford English school’s combination of critical agility with the principle of employing gentlemen of letters wherever possible. He was made a fellow of the British Academy in 1990 and appointed CBE in 1999.

In Oxford, Bayley’s dilettantish behaviour could be irritating, both as an examiner (losing scripts) and lecturer (advertising remote rooms, moving rooms, postponing meetings, changing topic without notice). Nor was his heart in the routines of faculty administration expected of him after his appointment to the Warton chair in 1974. He was a terrible member of committees like the botched one on syllabus reform, and in 1994 was criticised for his wayward chairing of the Booker prize panel.

Much of this game was forgivable and forgiven. It would have been churlish to hold his peccadilloes and weakness against the great critic who could really enthuse the young about literature. His enthusiasms were contagious. He made literature matter.

It might be hoped that literature’s lessons in human endurance would help get him through the sad years during which he tenderly looked after his wife as she sank deeper in the self-blankings of Alzheimer’s disease, which set in in the mid-1990s. He cooked up the schoolboy tuck the pair lived on at home, the baked beans and fishcakes, in their chaotic north Oxford kitchen, in which the mouldering tins accumulated and the disintegrating plastic bag really came into its own as storage device.

Bayley’s old-laggish retirement pieces in the Evening Standard surprised no one. Though his speedy marriage after Murdoch’s death in 1999 to their old friend Audihild (Audi) Villers certainly did. (And how rapidly she spruced up both him and the house – almost beyond recognition.) What’s more, the trilogy of sexually beans-spilling narratives he then produced, granting himself centre-stage in the Murdoch drama, shocked many of their friends as indecorous and ungracious.

Bayley lived down the castigation, though, and lived happily and gratefully with Audi for the last 15 years or so of his life. She survives him.

• John Oliver Bayley, critic and author, born 27 March 1925; died 12 January 2015