Recap
John uses the Greek phrase οἱ βασιλεῖς τῆς γῆς (and declensions) eight times (or nine, depending on one textual variant in Revelation 16).
The first time, it appears within a description of Jesus in chapter 1: Jesus is 'the ruler of the kings of the earth'. The final time, the phrase is used in chapter 21, combined with an allusion to Isaiah 60: the 'the kings of the earth' bring their glory into the new Jerusalem of the new creation.
All of the other uses appear between chapters 6 and 19, always in an explicitly negative context: these 'kings of the earth' suffer the judgment symbolized in the seven seals, trumpets, and bowls, finally concluding with their defeat by the rider of the white horse in chapter 19.
Influences
The Revelation 1 instance appears to be drawing on LXX Psalm 88, where we find an overlap of several key words: 'firstborn', 'the kings of the earth', and 'faithful witness':
Revelation 1.5
καὶ ἀπὸ Ἰησοῦ Χριστοῦ, ὁ μάρτυς, ὁ πίστος, ὁ πρωτότοκος τῶν νεκρῶν καὶ ὁ ἄρχων τῶν βασιλέων τῆς γῆς
LXX Psalm 88.28,38
κἀγὼ πρωτότοκον θήσομαι αὐτόν ὑψηλὸν παρὰ τοῖς βασιλεῦσιν τῆς γῆς . . . κατηρτισμένη εἰς τὸν αἰῶνα καὶ ὁ μάρτυς ἐν οὐρανῷ πιστός διάψαλμα
John here draws on this psalm to highlight Jesus' identity as a Davidic messiah; Jesus is the one whom God has exalted over all worldly powers ('the kings of the earth') in fulfillment of God's covenant with David (cf. LXX Psalm 88.28-29).
The next use of the phrase 'the kings of the earth' in Revelation does not appear until chapter 6, but even before we arrive at that chapter, something else catches our eye in chapter 2:
Revelation 2.18,26-27 (NRSV)
'And to the angel of the church in Thyatira write: These are the words of the Son of God, who has eyes like a flame of fire, and whose feet are like burnished bronze:
...
To everyone who conquers and continues to do my works to the end,
I will give authority over the nations;
to rule them with an iron rod,
as when clay pots are shattered—
even as I also received authority from my Father.
Note the points I've placed in bold text; they all come directly from Psalm 2. In this psalm, God speaks to the king of Israel (i.e. David or his descendants):
Psalm 2.6-9 (NRSV)
'I have set my king on Zion, my holy hill.'
I will tell of the decree of the Lord:
He said to me, 'You are my son;
today I have begotten you.
Ask of me, and I will make the nations your heritage,
and the ends of the earth your possession.
You shall break them with a rod of iron,
and dash them in pieces like a potter's vessel.'
Because of the high degree of overlap here, it is very important that the Septuagint version of Psalm 2 uses the phrase in question, 'the kings of the earth', to describe the people who rebel 'against the Lord and his Christ':
LXX Psalm 2.2
παρέστησαν οἱ βασιλεῖς τῆς γῆς καὶ οἱ ἄρχοντες συνήχθησαν ἐπὶ τὸ αὐτὸ κατὰ τοῦ κυρίου καὶ κατὰ τοῦ χριστοῦ αὐτοῦ διάψαλμα
Psalm 2 comes back in the Revelation at least three more times:
- Revelation 12.5 describes a 'male child' (presumably a symbol for Jesus) as ascending to God's throne in order 'to rule all the nations with a rod of iron',
- Revelation 14.1 has 'the Lamb' (Jesus) 'standing on Mount Zion',
- Revelation 19.11-16 has a highly symbolic depiction of Jesus, describing how 'From his mouth comes a sharp sword with which to strike down the nations, and he will rule them with a rod of iron'.
I would suggest that the Revelation has been shaped, in broad strokes, by a particular reading of Psalm 2. John has employed key phrases from the psalm and invested them with a specific symbolic significance throughout the Revelation.
In this case, John has borrowed the psalm's phrase 'the kings of the earth' and utilized it throughout his book to represent all those world rulers who stand opposed to The One Sitting On The Throne and The Lamb (i.e. LXX Psalm 2.2, 'the Lord and his Christ').
John brings his various references to Psalm 2 back together in Revelation 19: Jesus wields 'the iron rod' to rule 'the nations' and strike down those who oppose him; at the beckoning of the beast and his false prophet, 'the kings of the earth' rally against Jesus, only to be swiftly defeated, per the psalm.
Amid all this, LXX Psalm 88 may still stand behind John's use of the phrase, but LXX Psalm 2.2 has dominated the phrase's usage for John.
A twist ending?
After the severely negative depiction of 'the kings of the earth' throughout the Revelation, their reappearance in 21.24 is rather unexpected. In this passage, John has drawn extensively from Isaiah 60:
Revelation 21.22-27 (NRSV)
I saw no temple in the city, for its temple is the Lord God the Almighty and the Lamb. And the city has no need of sun or moon to shine on it, for the glory of God is its light, and its lamp is the Lamb. The nations will walk by its light, and the kings of the earth will bring their glory into it. Its gates will never be shut by day—and there will be no night there. People will bring into it the glory and the honour of the nations. But nothing unclean will enter it, nor anyone who practises abomination or falsehood, but only those who are written in the Lamb's book of life.
Isaiah 60.11,19 (NRSV)
Your gates shall always be open;
day and night they shall not be shut,
so that nations shall bring you their wealth,
with their kings led in procession.
. . .
The sun shall no longer be
your light by day,
nor for brightness shall the moon
give light to you by night;
but the Lord will be your everlasting light,
and your God will be your glory.
The Septuagint of Isaiah 60 doesn't use the phrase οἱ βασιλεῖς τῆς γῆς, and the Masoretic Hebrew makes no reference to 'the kings of the earth' either.
John appears to have deliberately imported the phrase 'the kings of the earth' from LXX Psalm 2 and/or 88 into his allusion to Isaiah 60.11. Given John's systematically negative portrayal of 'the kings of the earth' throughout the Revelation, I find his use of the phrase in a positive sense in chapter 21 to be surprising and optimistic.