Supposedly they were built to guard the tomb of an emperor:
So what’s up?
1. The emperor had a state-dependent utility function (e.g., money is worth less when you are dead), and this was the ancient equivalent of cryonics. If there was a chance you might be called back to life, spend a lot of resources protecting your corpse and its burial site.
2. The emperor was signaling (sorry Noah!) his ability to assemble such an impressive row of life-size figures, and of course the original had many more than what has been restored to date.
3. This was a form of fiscal policy, to stimulate the economy in slow times, by employing craftsmen.
4. The guild of said craftsmen was an influential interest group.
5. It was intended as a gift to a distant future; what else could they have done that would be of more value to us today?
6. Because the emperor could.