Pilate was a skilled politician, and typical Roman tactics were to be unconcerned with the internal politics of vassal regions. As long as tributes were paid and there were no uprisings, the Roman empire was typically unconcerned. In fact, the Roman empire actually preferred drama in their vassal states as this divided and conflicted the region. So long as the vassal was preoccupied with internal politics and worried about each other, they were not a risk against the rulership of the Roman Empire.
As it turns out, it does not appear that claiming to be King of the Jews was considered to be illegal (though claiming to be king of the Roman empire might be another matter entirely) This can be seen in a few episodes. For example, Herod the Great was concerned that his brother-in-law Aristobulus III might attempt to overthrow his throne to claim the title "King of the Jews" in his place and has him assasinated. Presumably, were it illegal for Aristobulus III to make this claim, Herod would have simply reported him to Roman authorities.
On the other hand, Herod the Great later had his sons executed for treason after a trial.
Similarly, however, Herod Antipas was overthrown by Herod Agrippa and his reign was recognized by Roman authority - so it seems that most often the claim of "King of the Jews" was not illegal, or if it was, these laws were often not enforced.
It seems that Jesus' accusers knew this and for this reason, they do not begin the charges against him to Pilate with the claim that Jesus was claiming to be King of the Jews, but instead that he is leading an insurrection and opposing tribute to Caesar in 23:1:
We have found this man subverting our nation. He opposes payment of taxes to Caesar...
These activities clearly are illegal and we see this from the note regarding Barabbas in 23:25 which tells us Barabbas actually had been imprisoned for insurrection.
He released the man who had been thrown into prison for insurrection and murder
Furthermore, Jesus never actually unambiguously and legally admitted to being King of the Jews. While some version report that Jesus said
It is as you say
The emphasis should be
It is as you say
and accordingly some translations like the NIV and ESV reflect this by translating this passage as
You have said so
Or
You say so (NET, NRSV, ISV)
With older translations rendering it as
Thou sayest it (KJV, YLT, DRA, ASV)
The NCV and CEV actually goes so far to translate as
Those are your words.
In greek, the phrase is
Σὺ λέγεις
Which literally translates as "you say". The NASB prefers to delineate the actual statement from the editorial implication using typography by italicizing "it is as" in some versions of the text (typography is really important!) rendering the phrase
“It is as you say.”
In other words, Jesus never actually unambiguously admits to being King of the Jews before Pilate. This is akin to responding "allegedly" with a coy smile. Was Jesus admitting this, or denying it? It could be interpreted either way, and Jesus, also being skilled in politics intentionally answers this way - simultaneously denying and confirming the claim.
In fact, this is seen in two later points. First, when it seems that Pilate is going to release Jesus, stating that he finds no basis for charges in 4, Jesus' accusers protest and re-iterate their charge in verse 5
He stirs up the people all over Judea...
Notice that they do not reiterate the claims that are not illegal and cannot be proven - that Jesus opposes payment of Taxes to Caesar (expressly disproven by Luke 20:25 - all three synoptic gospels note this scene) and that Jesus claims to be King of the Jews.
In fact, Pilate explicitly states his understanding of the charges against Jesus in 13-14, stating
Pilate called together the chief priests, the rulers and the people, 14 and said to them, “You brought me this man as one who was inciting the people to rebellion. I have examined him in your presence and have found no basis for your charges against him.
So it seems that either Pilate A) did not understand Jesus to be making the claim that Jesus was King of the Jews or B) that this claim was not illegal so long as it did not interfere with Roman rule. Having claimed no less than three times that there was no basis for charges against Jesus as noted in 22
For the third time he spoke to them: “Why? What crime has this man committed? I have found in him no grounds for the death penalty.
Mark records that Pilate even regarded Jesus response as a non-response noting 14:2-5 (NET):
So Pilate asked him, “Are you the king of the Jews?” He replied, “You say so.” Then the chief priests began to accuse him repeatedly. So Pilate asked him again, “Have you nothing to say? See how many charges they are bringing against you!” But Jesus made no further reply, so that Pilate was amazed.
and made a big show of washing his hands in Matthew, the final verdict was "Not Guilty". This means that Pilate was expressly not acknowledging Jesus as a king - either of the Jews or the Roman Empire.
It is also worth stating that nowhere is it noted that pilate placed the charges above Jesus accusing him of being "King of the Jews" but instead, this appears to be a liberty taken by his executioners with the text stating:
The soldiers also came up and mocked him. They offered him wine vinegar and said, “If you are the king of the Jews, save yourself.” There was a written notice above him, which read: This is the King of the Jews.
This is also not a formal charge, but is meant to be ironic - "this dying, naked prisoner is King of the Jews. Haha. Isn't that hilarious Bob? Me too hahaha!"
Instead, the reason Pilate has Jesus executed is not because he is found guilty, but because the situation places Pilate in a tough political position. So first, he tries to pass the buck. If the Jews execute him, then the Roman Empire cannot be blamed for his death and there is no risk of insurrection. But obviously, that doesn't pan out for Pilate, so he is faced with a new dilemma. On the one hand, if he doesn't execute Jesus, he risks letting go the leader of an insurrection, which could be bad. On the other hand, if he kills him and creates a martyr, this could be considered draconian response by the Roman Empire and cause a revolt by the Jews. So his best option was to execute Jesus while disavowing the action and placing the blame for it on the Jews.