In ancient Mesopotamian civilization, Ziggurats were built for local religions. These were raised platforms in temple complexes that accommodated many rooms and chambers for temple priests to take care of the God and Goddess. They were built with a notion that the temples will be closer to heaven and also Gods.
The kings would continuously rebuild the ziggurats above the old one to prove their religious dedication and fervor.