One is often tempted to think that Psalm 24 was composed as a kind of prophecy about Jesus' triumphal entry to Jerusalem near the beginning of passion week. If it was thus intended, then it was a poor prophecy because very little was fulfilled. Specifically,
- The Psalm is addressed to the King of Glory, YHWH/ the LORD Almighty. While it is true that such epithets were (and still are) valid for Jesus, at the triumphal entrance Jesus was merely hailed as king of the Jews, not King of Glory and definitely not Jehovah Almighty.
- Psalm 24 is an antiphonal psalm requiring two choirs which were conspicuously absent at Jesus’ entry to Jerusalem.
- The actual fulfilment of the Ps 24 prophecy is possibly found in places like Rev 11:15-18, 19:16 where Jesus is given the title King of Kings, Lord of Lords, Lord of hosts, etc, and the kingdoms of this world are formally handed over the Jesus.
This is the main difference between Jesus’ first and second advents: the first coming was as a meek lamb; the second coming will be as a triumphal conquering king of the universe. The triumphal entry of Jesus into Jerusalem was only a foretaste of these later events.
The "gates" and "doors" must be understood figuratively. In its original setting, the Psalm was possibly intended by David as a celebration of the arrival of the Ark of the Covenant into the tabernacle at Jerusalem. This prefigured and symbolised the triumphal arrival of Jesus to the heavenly sanctuary.
Note the comments of MacLaren:
This whole psalm was probably composed at the time of the bringing of
the ark into the city of Zion. The former half was chanted as the
procession wound its way up the hillside. It mainly consists of the
answer to the question ‘Who shall ascend into the hill of the Lord?’
and describes the kind of men that dwell with God, and the way by
which they obtain their purity.
This second half of our psalm is probably to be thought of as being
chanted when the procession had reached the summit of the hill and
stood before the barred gates of the ancient Jebusite city. …
We are to conceive of a couple of half choirs, the one within, the
other without the mountain hold. The advancing choir summons the gates
to open in the grand words: ‘Lift up your heads, O ye gates! even lift
them up, ye everlasting doors, and the King of Glory shall come in.’ …
The answer to the summons comes from the choir within. ‘Who is this
King of Glory?’ the question represents ignorance and possible
hesitation, as if the pagan inhabitants of the recently conquered city
knew nothing of the God of Israel, and recognised no authority in His
name.