Jitendra, it was not only legalised but state sponsored. Kautilya's Arthashashtra documents it. And do I need to remind that Kautilya was the chancellor of Chandragupta Maurya, who we try to appropriate as a Jat (probably with some merit, but it is a controversial thesis).
Below is an excerpt from a research paper on position of women in that period. And, let me clarify before anyone starts getting feisty,
that this is specifically for culture vultures, of "hamaari sanskriti aur sabhyata" types. It is NOT my belief that just because something happened in the past or was part of our culture, then it should continue to remain so with/without merit.
Link:
http://www.asiaticsociety.org.bd/journals/June_2009/contents/Protiti shirin.htm
Excerpts:
Prostitution was a state-endorsed activity, and it generated revenues for the state. The prostitute, usually the madam or the head of a brothel and her deputy were given lump sums by the state to establish brothels and to buy jewellery, furniture, etc.
Nonetheless, like the dependent prostitute, the independent one also paid one-sixth of her income as tax to the state. [22] In times of financial trouble for the state, she had to pay extra revenue to the state and the independent ones were obliged to pay half of their income as tax. [23] It was clear that the prostitute’s income was a stable source of state revenue and to generate it, the state encouraged prostitution by direct methods. The courtesan had to possess a wide range of accomplishments ranging from speaking as is evident in the Ramayana [24] to painting to love-making.
To avoid her total exploitation, the Arthashastra granted the prostitute some legal projection. For example, the rape of a prostitute was regarded as a crime.
However, even the common prostitute was granted certain legal rights which would protect her. She was protected from cheating, robbery, abduction, confinement or disfigurement. Moreover, there was special legal care to protect the virginity of a prostitute’s daughter. A man had to pay a fine that was sixteen times higher than the fee of a visit to a prostitute if he deflowered her daughter by choice or by force