In Hebrews, the point the author is making is that Jesus is legitimate as a priest, because Jesus is the king of Jerusalem, and the king has a priestly title and powers in addition to his secular powers.
The king of Jerusalem (and therefore of Judea), was always accorded priestly privileges as part of his powers as king.
Melchizedek is the first such example. Because he was king of (Jeru)Salem, he was also priest of God. That was part of his titles.
When King David speaks about Melchizedek in Psalms 110, David claims priestly privileges as part of his kingship, as Melchizedek before him had:
Psa 110:4 The LORD hath sworn, and will not repent, Thou [art] a priest for ever after the order of Melchizedek.
David intercedes for Israel with God directly, goes into the holy place to speak with God, eats the shewbread, and does many other things that are reserved for priests. Davids justification is that God has accorded the king priestly powers.
Jesus, like David, like Melchizedek, was king of Jerusalem. As such, He inherited the title "priest after the order of melchizedek" with all the powers implied by such title.