Image copyright Thinkstock

Paintings and carvings in ancient Indian temples challenge Western ideas of the relationship between spirituality and sexuality, says writer and historian William Dalrymple.

In the early summer of 1819, a British hunting party, lost in the arid mountains of the Western Ghats, made a remarkable chance discovery.

Following a tiger into a remote and narrow river valley, the hunters stumbled onto what was soon recognised as one of the great wonders of India - the painted caves of Ajanta.

On the walls of a line of 31 caves dug into an amphitheatre of solid rock, lie the most ancient and beautiful paintings in Buddhist art, the oldest of which date from the 2nd Century BC—an otherwise lost golden age of Indian painting. Along with the frescoes of Pompeii, Ajanta represents the greatest picture gallery to survive from the ancient world and the most comprehensive depiction of civilised classical life that we have.

About the author William Dalrymple is a writer and historian

A Point of View is usually broadcast on Fridays on Radio 4 at 20:50 BST and repeated Sundays, 08:50 BST Or catch up on BBC iPlayer

The Ajanta murals tell the Jataka stories of the lives of the Buddha in images of supreme elegance and grace. The artists produced images that subtly explore a wide variety of human situations, from ascetic renunciation through portraits of compassionate Bodhisattvas of otherworldly beauty swaying on the threshold of Enlightenment, through to more earthy scenes of courtly dalliance in long lost ancient Indian pleasure gardens.

Although the images were presumably intended for a monastic audience, the Buddha tends invariably to be shown not in his monastic milieu, after his Enlightenment, but in the courtly environment in which he grew up. Here among handsome princes and nobles, dark-skinned princesses languish love-lorn, while heavy-breasted dancing girls and courtesans are shown nude but for their jewels and girdles, draped temptingly amid palace gardens and court buildings. These women conform closely to the ideas of feminine beauty propagated by the great 5th Century playwright Kalidasa, who writes of men pining over portraits of their lovers, while straining to find the correct metaphors to describe them: "I recognise your body in liana; your expression in the eyes of a frightened gazelle; the beauty of your face in that of the moon, your tresses in the plumage of peacocks... alas! Timid friend- no one object compares to you." As the great Indian art historian Vidya Dehejia puts it, "the idea that such sensual images might generate irreverent thoughts did not seem to arise; rather the established associations appear to have been with accentuated growth, prosperity and auspiciousness." That is why the monasteries of Ajanta were filled with images of beautiful women - because in the eyes of the monks this was completely appropriate decoration.

Image copyright Alamy Image caption Murals in the temple at Ajanta

When I first saw these caves at the age of 18, it was this that gave me pause for thought. Why, I wondered, would a monastery built for celibate Buddhist monks be decorated with images of beautiful, bare-breasted palace women? Returning last week after a gap of 30 years, I was again struck by the same thought. In the Christian world, this was the middle of Lent, the season of self-discipline and self-deprivation, but here I was in the middle of a celibate monastic community which had voluntarily chosen to live the austere ascetic path in small rock-cut cells, and yet was making a deliberate decision to cover the walls of its religious buildings with images of attractively voluptuous women.

The figures of Gods and Goddesses are shown in such obscene Postures, that it would puzzle the Covent Garden nymphs to imitate them 18th Century European traveller in India

I am hardly alone in being surprised by this. Westerners coming to India have always been baffled to encounter a very different set of attitudes to the sensuous and its relationship to the sacred. Here it is considered completely appropriate to cover the exterior walls of a religious building with graphically copulating couples.

Christianity, in contrast, has always seen the human body as essentially sinful, lustful and shameful, the tainted vehicle of the perishable soul, something which has to be tamed and disciplined - a fleshy obstacle to salvation. A decade ago I remember spending another Lent in the austere desert monasteries of Coptic Egypt. It was here, in the dying days of the Roman empire, that Christian doctrines about the inherent sinfulness of the human body were first formulated. In opposition to the classical Roman love of sensuality, the early Christian monks set out to mortify their bodies and fight off all the temptations of the flesh. It is only by defying your urges and casting off the body, the Coptic monks maintained, that you can attain perfection. We are dust and to dust we shall return. These attitudes have never entirely left the Western Christian tradition.

Image copyright Alamy Image caption Inside the caves of Ajanta

For the colonial British, Indian art's obsession with the sensual body always provided a block to the appreciation of Indian art. Indian sculpture was deemed immoral and contact with it was believed to infect the moral sensibility. As early as the 17th Century, European travellers were railing about temples filled with "much immodest, heathen-style fornication and other abominations…. [and] so full of lascivious figures of Monsters, that one cannot enter them without horror". Even in the libertine 18th Century one gentleman complained that "the figures of Gods and Goddesses are shown in such obscene Postures, that it would puzzle the Covent Garden nymphs to imitate them".

But to pre-colonial Indians there was no association of women with sin, and in all the voluminous Indian scriptures there is no Eve, taking the fall for the Fall. Women were associated not with temptation but instead with fertility, abundance and prosperity, and there is an open embrace of sexuality as one route to the divine. "In the embrace of his beloved, a man forgets the whole world, everything both within and without," states the Brihadaranyaka Upanishad. "In the very same way, he who embraces the Self knows neither within nor without."

For this reason throughout their long history, the arts of India - both visual and literary - have consistently celebrated the beauty of the human body. Indeed the whole tradition of yoga was aimed at perfecting and transforming the body, with a view, among the higher adepts, to making it transcendent, omniscient, even god-like. The body, in other words, is not some tainted appendage to be whipped into submission, but potentially the vehicle of divinity. In this tradition, the sensuous and the sacred are not opposed. They are one, and the sensuous is seen as an integral part of the sacred. The gods were always depicted as superhumanly beautiful, for if the image was not beautiful then the deities could not be persuaded to inhabit the statue.

This obsession with the beauty of the human body survived waves of invasions, and the arrival of Islam in South Asia. Indeed by the early 18th Century we see explicit images of the Emperor Muhammad Shah "Rangila" or Colourful, making love with his mistress. It was not, therefore, the Islamic period that brought the dramatic break with India's sensual traditions. Instead, that break happened during the colonial period, with the arrival of Christian missionaries in the 19th Century. In reaction to British diatribes about "Hindoo immorality" a new generation of British-educated Hindu reformers began critically to re-examine their own traditions. A movement arose urging Hindu women to cover themselves up, and chastity and modesty were elevated as the ideal attributes of Hindu womanhood.

Image copyright Getty Images Image caption A protester in Mumbai against the criminalisation of gay sex

Today, there is much embarrassment and denial about the role of erotic in pre-modern India. When asked to come up with a response to the growing Indian Aids crisis a few years ago, the then health minister proclaimed that India's native traditions of chastity and fidelity were more effective than the use of condoms. More recently, last December, the Indian Supreme Court upheld a law which criminalised gay sex, maintaining, again, it was against Indian tradition. The minister and the judge had apparently never heard of the Kama Sutra or visited the erotic temples of Khajaraho - or indeed delved into the rich courtly tradition of Rajasthani lesbian love poetry.

To me this interesting clash of perceptions holds many lessons. We are all culturally programmed, perhaps especially so in matters of sex and sensuality. We assume that many of our values are universal when they are in fact highly subjective and personal.

It also shows how easily we reflect present day moral values onto the past. We assume Buddhist monks would disapprove of and avoid sensual images, but the blatant sensuality of the art of early Buddhism in Ajanta and other early Buddhist sites across India, is overwhelming. If history and art history have any value beyond entertainment and offering us lessons and examples from the past, it is perhaps, like travel, to free us from the tyranny of our own cultural values and make us aware of how contingent and bound by time, culture and geography so many of our preconceptions actually are.

A Point of View is broadcast on Friday on Radio 4 at 20:50 BST and repeated on Sunday at 08:50 BST. Catch up on BBC iPlayer

Follow @BBCNewsMagazine on Twitter and on Facebook