Building a temple was one of the main duties of a Sumerian king. Numerous inscriptions tell us about kings building temple(s). Some of them wereon the walls or on statues, but others were written on objects buried in the foundations or on nails hammered in the walls.
These were for the gods, as proofs or reminders of the identity of the king who has built the temple. Hence, the kings make sure that the gods will remain favourable to his kingdom. These inscriptions often ended with a curse: the best way to dissuade any ennemy king to destroy the temple.