Why was the entering of Jesus into Jerusalem considered triumphant if he went there to die?

This event was to fulfil prophecy.

Triumphant? Because Jesus had come to earth 'on assignment'.

Consider what he had accomplished: a) He taught mankind about God, and God's requirements; so he fulfilled the role of a 'great Teacher'. b) He had performed 3 circuits around various areas of Palestine, causing people to hear all the clamor about him. c) He had healed people; even raised the dead. For those people who didn't already recognize him as the fortold Messiah, at least they wondered about it. d) and he was now proceeding to his final days just before he would permit himself to be 'sacrificed' (submissive like Issac when Abram brought him to Mt Moriah) as the Redeemer of the Human Race (Mankind).

One time Jesus even said: "I have conquered the world", even though it had not happened yet; it was so sure of happening that he spoke in the past as if it had already happened.

Jesus had come 'on assignment' and had by now just about 'completed' it. He was triumphant in the superlative degree. And while all the people may not have recognized the full impact of it, nevertheless this was monumental. The prophecy was fulfilled in him.

Example: When people brought their animal to the temple for sacrifice; they were not 'sad' about losing an animal (their best), but 'jubilant' to sacrifice it to God Almighty.