A young devadasi interviewed in Storyville: Sex, Death and the Gods. Photograph: BBC

Parvatamma is a devadasi, or servant of god, as shown by the red-and-white beaded necklace around her neck. Dedicated to the goddess Yellamma when she was 10 at the temple in Saundatti, southern India, she cannot marry a mortal. When she reached puberty, the devadasi tradition dictated that her virginity was sold to the highest bidder and when she had a daughter at 14 she was sent to work in the red light district in Mumbai.

Parvatamma regularly sent money home, but saw her child only a few times in the following decade. Now 26 and diagnosed with Aids, she has returned to her village, Mudhol in southern India, weak and unable to work. "We are a cursed community. Men use us and throw us away," she says. Applying talcum powder to her daughter's face and tying ribbons to her hair, she says: "I am going to die soon and then who will look after her?" The daughter of a devadasi, Parvatamma plans to dedicate her own daughter to Yellamma, a practice that is now outlawed in India.

Each January, nearly half a million people visit the small town of Saundatti for a jatre or festival, to be blessed by Yellamma, the Hindu goddess of fertility. The streets leading to the temple are lined with shops selling sacred paraphernalia – glass bangles, garlands, coconuts and heaped red and yellow kunkuma, a dye that devotees smear on their foreheads. The older women are called jogathis and are said to be intermediaries between the goddess and the people. They all start their working lives as devadasis and most of them would have been initiated at this temple.

Girls from poor families of the "untouchable", or lower, caste are "married" to Yellamma as young as four. No longer allowed to marry a mortal, they are expected to bestow their entire lives to the service of the goddess.

The devadasi system has been part of southern Indian life for many centuries. A veneer of religion covers the supply of concubines to wealthy men. Trained in classical music and dance, the devadasis lived in comfortable houses provided by a patron, usually a prominent man in the village. Their situation changed as the tradition was made illegal across India in 1988, and the temple itself has publicly distanced itself from their plight.

The change started in colonial times. Academics dispute what the British thought of the custom, but their presence meant that kings and other patrons of temples lost their power and much of their economic influence.

Now the system is seen as a means for poverty-stricken parents to unburden themselves of daughters. Though their fate was known, parents used religion to console themselves, and the money earned was shared.

Roopa, now 16, has come to buy bangles at the festival. She was dedicated to the goddess seven years ago and was told that Yellamma would protect her. Her virginity was auctioned in the village, and since then she has supported her family by working as a prostitute out of her home in a village close to Saundatti.

"The first time it was hard," she admits. In fact, her vagina was slashed with a razor blade by the man she was supposed to sleep with the first time. Her future, like that of other devadasis, is uncertain. Once they are around 45, at which point they are no longer considered attractive, devadasis try to eke out a living by becoming jogathis or begging near the temple.

Chennawa, now 65 and blind, is forced to live on morsels of food given by devotees. "I was first forced to sleep with a man when I was 12," she says. "I was happy that I was with Yellamma. I supported my mother, sisters and brother. But look at my fate now." She touches her begging bowl to check if people have thrown her anything. "My mother, a devadasi herself, dedicated me to Yellamma and left me on the streets to be kicked, beaten and raped. I don't want this goddess any more, just let me die."

"For certain SC communities [Scheduled Caste – a government classification of lower castes] this has become a way of life, sanctioned by tradition," he says. The priests conduct the ceremonies in their own houses because "it is profitable for them".

Patil started Vimochana partly to stop the children of devadasis becoming devadasis themselves. He set up a residential school for devadasi children in his own home 21 years ago, in order to train them to become teachers or nurses. Enduring protests from neighbours who did not want to live near the untouchable children of prostitutes, the school has gone on to educate more than 700 children, and is today housed in several buildings. "More than 300 of these children are married and have become part of society," he says.

Roopa does not know what her future is. She says that although she does not like to be "touched" by many men, the money feeds her family. "I would like to be a teacher, but this is my fate." she says. As she walks past Chennawa, she adds: "When I am old like this aayi [grandmother] I may become blind like her."

Roopa places some food in Chennawa's hands: "I hope some one will look after me then. I am not counting on Yellamma though." She wears her new bangles, admires them and says it is time for her to go back to work.

• Beeban Kidron's Storyville film about the devadasi system, Sex, Death and the Gods, will be shown on BBC4 on Monday 24 January at 10pm