Toilets were dirty places in the past (and still are in India today! even though they need not be so). To teach hygiene in the past everything was put into a religious context, otherwise how can you convince ignorant masses to respect any law including the basic rules of hygiene? Why else was the toilet always outside the house in the olden days? Why were women kept separately during certains days of the month? Why was washing your hands and feet before you enter the house or pray compulsory? Why did you change your clothes after coming back home and kept them separately from the washed clothes? Why are bedclothes after illness washed separately and disinfected with smoke and medicinal plants in infusion? Why did people use haldi when bathing? Why do you take off your shoes when you go to the mosque, temple or enter a house? All these practises have become an integral part of religion to teach the masses who could not possibly understand the concept of germs spreading disease through contact, that hygienic practises are necessary so you can stay healthy. Please remember that Islam came to India only in the 9th century AD, most of the customs were already there and incorporated into Islam. One thing is to use this knowledge and incorporate it with modern science for everyone's good, not to enlighten the masses just to rule is something else.