Temples in Ancient Times
Temples are frequently mentioned in Mahabharata.
For instance, in Vana Parva, Krishna describes an invasion of Dwakara by king Salva. Krishna says Salva’s army occupied all places of Dwaraka excepting temples dedicated to Gods and cemeteries. Here is English translation of relevant portion.
Another reference from the story of Nala and Damayanti. The temples were adorned with flowers in Vidarbha, the capital of Damayanti’s father Bhima, on Nala’s arrival.
“Rama ate the remainder of clarified butter after finishing the sacrifice, which he performed for his own good, silently meditated on Lord Narayana with controlled mind and slept along with Seetha on a properly laid bed of Kusa grass in a splendid temple of Lord Vishnu.”
Sources: