In Ezekiel 37 as well as Ezekiel 34, there is a "David", and he is described as a "servant" of God, and a "king" and then a "prince".
First of all, the context is Zion, after the day of the LORD, which is the Second Coming of Jesus Christ. This is why Judah and Israel will be combined into one kingdom again: human Jews serving as priests, plus 144000 saints of Jacob including the 10 lost tribes of ancient Israel serving as soldiers.
Say unto them, Thus saith the Lord GOD; Behold, I will take the stick of Joseph, which is in the hand of Ephraim, and the tribes of Israel his fellows, and will put them with him, even with the stick of Judah, and make them one stick, and they shall be one in mine hand.
Ezekiel 37:19
And say unto them, Thus saith the Lord GOD; Behold, I will take the children of Israel from among the heathen, whither they be gone, and will gather them on every side, and bring them into their own land: And I will make them one nation in the land upon the mountains of Israel; and one king shall be king to them all: and they shall be no more two nations, neither shall they be divided into two kingdoms any more at all:
Ezekiel 37:21-22
The next thing to know is that on the day of the LORD, David, as in king David of old, will be made a saint, one of the 144000 of Israel. This explains "wings of the morning" in Psalms 139:9, which is a Psalm of David.
If I take the wings of the morning, and dwell in the uttermost parts of the sea; Even there shall thy hand lead me, and thy right hand shall hold me.
Psalms 139:9-10
Now, have a look at the verses in question in Ezekiel 37.
To begin with, Ezekiel 37:23-24.
Neither shall they defile themselves any more with their idols, nor with their detestable things, nor with any of their transgressions: but I will save them out of all their dwellingplaces, wherein they have sinned, and will cleanse them: so shall they be my people, and I will be their God. And David my servant shall be king over them; and they all shall have one shepherd: they shall also walk in my judgments, and observe my statutes, and do them.
Ezekiel 37:23-24
Here you see the remnant of Judah, ie. human Jews, having been cleansed and made holy, become the people of God. That is to say, every Jew baptised with the Holy Spirit (ref. Joel 2:28-29, Zechariah 12:10). This is the new covenant between God and Judah (ref. Jeremiah 31:31-34, Hebrews 8:8-13).
And then, "David", whom God describes as "my servant", shall be "king" over them, and also their "shepherd". This is the Son of man Jesus Christ, who is to be the first king of the kingdom of God, and even a king of the world, as in the King of kings.
Although David will be alive and around at this time as a saint, a soldier of Zion, he will not be the king, because the creator and God of the 144000 saints will be here on earth and he is to sit on the throne of the house of Jacob, per the prophecy of Luke 1:31-33.
And, behold, thou shalt conceive in thy womb, and bring forth a son, and shalt call his name JESUS. He shall be great, and shall be called the Son of the Highest: and the Lord God shall give unto him the throne of his father David: And he shall reign over the house of Jacob for ever; and of his kingdom there shall be no end.
Luke 1: 31-33
In his day, David was a literal shepherd of sheep, and he became a king of Israel (ref. 1 Samuel 16:13, 2 Samuel 2:4, etc), and he even slew a lion and a bear (ref. 1 Samuel 17:34-35). In all these ways, he was a foreshadowing of Jesus Christ, who is the "righteous servant" of God (ref. Isaiah 53:11, Isaiah 42:1, etc), "the good shepherd" (John 10:11-14), and the one that will overcome the two Antichrists: the Assyrian of Nineveh (lion) and Gog of Magog (bear). David might have actually been God's plan A for Israel. But David went astray and then so did his son Solomon. After that, a different approach, and a new covenant, became necessary, ie. plan B.
Now, the Hebrew name "David" דוד means "beloved". Notice, in his day as the Son of man, on a number of occasions, Jesus Christ was described by God as his "beloved" Son.
And Jesus, when he was baptized, went up straightway out of the water: and, lo, the heavens were opened unto him, and he saw the Spirit of God descending like a dove, and lighting upon him: And lo a voice from heaven, saying, This is my beloved Son, in whom I am well pleased.
Matthew 3:16-17
While he thus spake, there came a cloud, and overshadowed them: and they feared as they entered into the cloud. And there came a voice out of the cloud, saying, This is my beloved Son: hear him. And when the voice was past, Jesus was found alone. And they kept it close, and told no man in those days any of those things which they had seen.
Luke 9:34-36
The point is that Jesus Christ is the new David, certainly the David of Ezekiel 37 and 34.
So, in Ezekiel 37:24, David, as in Jesus Christ, is the king and the shepherd of the newly formed kingdom of God. And then in Ezekiel 37:25, the same David, a servant of God, is described as a "prince" of the house of Jacob forever.
And David my servant shall be king over them; and they all shall have one shepherd: they shall also walk in my judgments, and observe my statutes, and do them.
Ezekiel 37: 24
And they shall dwell in the land that I have given unto Jacob my servant, wherein your fathers have dwelt; and they shall dwell therein, even they, and their children, and their children's children for ever: and my servant David shall be their prince for ever.
Ezekiel 37: 25
Now, you might wondering why is it that at first this servant of God is a king but then afterwards a prince. To this, I should point out that by definition the Millennial Reign of Jesus Christ will go for 1000 years. So, Jesus Christ is to reign on the throne as God's anointed king for 1000 years, and then Jesus Christ will deliver the kingdom up to God the Father, because after all it is "the kingdom of God".
Yet have I set my king upon my holy hill of Zion. I will declare the decree: the LORD hath said unto me, Thou art my Son; this day have I begotten thee. Ask of me, and I shall give thee the heathen for thine inheritance, and the uttermost parts of the earth for thy possession. Thou shalt break them with a rod of iron; thou shalt dash them in pieces like a potter's vessel.
Psalms 2:6-9
Then cometh the end, when he shall have delivered up the kingdom to God, even the Father; when he shall have put down all rule and all authority and power. For he must reign, till he hath put all enemies under his feet.
1 Corinthians 15:24-25
At that point, God the Father, though invisible, will be the king of the kingdom of God, and the Son of man Jesus Christ will be his "prince", even "the Prince of princes", which is an expression that occurs in Daniel 8:25.
God the Father will reside in the house of God, described in Ezekiel 40-44, which will be built during the Millennial Reign of Jesus Christ, and which is also known as God's "tabernacle" and "sanctuary".
Moreover I will make a covenant of peace with them; it shall be an everlasting covenant with them: and I will place them, and multiply them, and will set my sanctuary in the midst of them for evermore. My tabernacle also shall be with them: yea, I will be their God, and they shall be my people. And the heathen shall know that I the LORD do sanctify Israel, when my sanctuary shall be in the midst of them for evermore.
Ezekiel 37:26-28
Around this time, the Gog of Magog thing will happen, and God the Father will be "the Holy One in Israel" and Jesus Christ will be in heaven.
And I will send a fire on Magog, and among them that dwell carelessly in the isles: and they shall know that I am the LORD. So will I make my holy name known in the midst of my people Israel; and I will not let them pollute my holy name any more: and the heathen shall know that I am the LORD, the Holy One in Israel.
Ezekiel 39:6-7
Now, if you look at Ezekiel 34, you will see more or less the same idea: that the servant "David" is at first God's anointed "shepherd", and then a "prince". At first, he is a king and then a prince. Again, this is because the Millennial Reign will go for 1000 years.
Therefore will I save my flock, and they shall no more be a prey; and I will judge between cattle and cattle. And I will set up one shepherd over them, and he shall feed them, even my servant David; he shall feed them, and he shall be their shepherd. And I the LORD will be their God, and my servant David a prince among them; I the LORD have spoken it.
Ezekiel 34:22-24
Remember, Jesus Christ is the Son of God, begotten before everyone else and before all things. Jesus Christ is a God, the creator of all life including animals, humans, angels, and saints. Jesus Christ is a visible God. But God the Father, who is invisible, is to Jesus Christ both his father and also his God. So, there is one eternal "God", and his Son Jesus Christ is our "Lord" and also our God.
Grace be with you, mercy, and peace, from God the Father, and from the Lord Jesus Christ, the Son of the Father, in truth and love.
2 John 1:3
Jesus Christ is almighty and for ever, because God the Father, who also has the power to resurrect, is eternal and he is always with his Son!
See now that I, even I, am he, and there is no god with me [Jesus Christ speaking]: I kill, and I make alive; I wound, and I heal: neither is there any that can deliver out of my hand. For I lift up my hand to heaven, and say, I live for ever.
Deuteronomy 32:39
As for why the name "David" occurs in Ezekiel 37 and 34, that might be due to the fact that there was once a plan A and now we are at plan B.
For if that first covenant had been faultless, then should no place have been sought for the second. For finding fault with them, he saith, Behold, the days come, saith the Lord, when I will make a new covenant with the house of Israel and with the house of Judah: Not according to the covenant that I made with their fathers in the day when I took them by the hand to lead them out of the land of Egypt; because they continued not in my covenant, and I regarded them not, saith the Lord.
Hebrews 8:7-9
To recap, after the Millennial Reign, when Jesus Christ will be in heaven, God the Father will reign as king of the kingdom of God, and the 12 apostles should be the new government, a kind of collective rule. No one, neither human nor angel nor saint, will be permitted to claim the throne for himself and take Zion in another direction.
At this time, I will continue to be a weapon of God.
And he said, It is a light thing that thou shouldest be my servant to raise up the tribes of Jacob, and to restore the preserved of Israel: I will also give thee for a light to the Gentiles, that thou mayest be my salvation unto the end of the earth. Thus saith the LORD, the Redeemer of Israel, and his Holy One, to him whom man despiseth, to him whom the nation abhorreth, to a servant of rulers, Kings shall see and arise, princes also shall worship, because of the LORD that is faithful, and the Holy One of Israel, and he shall choose thee.
Isaiah 49:6-7
And then, when the sun burns up the planet earth, Jesus Christ will create a new Jerusalem, and Jesus Christ will become the light of the world once again.
And I saw no temple therein: for the Lord God Almighty and the Lamb are the temple of it. And the city had no need of the sun, neither of the moon, to shine in it: for the glory of God did lighten it, and the Lamb is the light thereof.
Revelation 21:22-23