Answer:
Its purpose is to get the temple closer to the heavens, and provide access from the ground to it via steps. The Mesopotamians believed that these pyramid temples connected heaven and earth. In fact, the ziggurat at Babylon was known as Etemenanki, which means "House of the foundation of heaven and earth" in Sumerian.