People go to the temple to worship the deity.
Usually, people are not aware in detail of the “concept of the temple”
The fundamental principle is to make you feel or get a serene experience of “God”
If somebody asks you to believe in his religion without any experiential evidence or a valid rational explanation, then believing might give you some escape mechanism for your day-to-day problems in life, beyond that it will not enhance your spirituality. This is also a problem with religion which can make you blind believer and reduce your rational thinking ability, and we see the problems in the world right now because of this.
Ancient rishis understood this and created temples to help people get an experience of “God”, and also made temples as a meeting point for philosophical discussions, learning, feeding poor people, provide security in case of enemy attack.
Please click to see the Top 10 Temples in India
Temples are traditionally constructed in accordance with the principles of Vastu Shastra, which is a form of architecture based on certain mathematical principles. However, they are also often designed to conform to their local topology.
The temple serves as a place of worship for the deity that is enshrined within or associated with it. Most Hindu temples are open to all.
If you want to see a rational definition of god, please see defining-god
One of the best-constructed temples with a lot of science is “Konark Temple”
Please see the Mind-Blowing story of this Massive temple