Tantra & Erotic Sculpture
To varying degrees Tantra touched virtually all of Indian culture, especially art, architecture, and literature. Tantra found an expression in the sensual sculpture of the Indian temples, which envisions the coupling of the male and the female as union with the divine and the total release of the soul in the godhead. The erotic is but a means to the eternal Brahman.
Another theory for erotic sculpture around the temple walls is that it is also a test for the devotee to see whether he has purged his mind of all sensual and worldly thoughts before he enters the temple.