A Ziggurat is a building, and specifically a temple. (as such it cant be used to hold back floodwaters or irrigate fields: it's a building).
the correct answer is: B. keep the gods and goddesses happy.
However, it is speculated that they could also have been used during invasions for protection, but this was not their major function.