I was reading the Wikipedia page on Marduk and it said "In the city of Babylon, he resided in the temple Esagila." Just as the god of the Hebrews was thought to "reside" in the holy of holies in the temple in Jerusalem. So my question is this, did the ancient peoples of the near east think that their Gods resided bodily in their temples or was it more of a spirit thing. As a further question, what was the reason for them having a physical dwelling place in the first place?
The short answer is yes! Absolutely!
The primary source you'll want to look at is Benjamin Sommer's Bodies of God.
Basically, there was this phenomenon in the ancient near east called the local manifestation of deities. The idea is that deities can be physically present in various locales at the same time in this fractalized sense. This way you can have a Yahweh of Samaria and a Yahweh of Teman. You can have an Ishatar of Arbella and an Ishtar of Nineveh.
Deities were fed and "watered," where a worshipper offered food and drink to the deity, which the deity was then thought to actively eat in a shared meal with the worshipper and officiant. We can see this in the Ugaritic texts of Aqhat, where the character Dan'el hoped for a son to help him perform gm these ritual activities.
Deities were perceived to have had bodies. With these bodies they went to war, ate, drank, and participated in cultivated activities with their adherents.
We can see this, too, with the ark of the covenant, which was basically the throne of Yahweh upon which he sat in both the Tabernacle and the Temple.