Why did Pilate insist on writing 'Jesus of Nazareth, King of the Jews'? From John 19 (KJV):

19 And Pilate wrote a title, and put it on the cross. And the writing was JESUS OF NAZARETH THE KING OF THE JEWS.
20 This title then read many of the Jews: for the place where Jesus was crucified was nigh to the city: and it was written in Hebrew, and Greek, and Latin.
21 Then said the chief priests of the Jews to Pilate, Write not, The King of the Jews; but that he said, I am King of the Jews.
22 Pilate answered, What I have written I have written.

The chief priests appear to be protesting at what Pilate has written, presumably because it appears to be affirming what they wish to deny. They ask him write instead that 'he said, I am King of the Jews' - notably they do not ask him to remove the title altogether, or to write a denial.
Why does Pilate affirm what he has written?
Crucifixion was more than a method of execution; it was a public execution, and a long, slow, exceptionally painful one at that.  Half the point was to make an example of the condemned so they could act as a deterrent.

Part of the process was to identify the person and their crime, which was done by putting a sign on the cross.  Thing is, Pilate couldn't actually identify any crime that Jesus had committed.  But the Jewish leaders were adamant about sending him to the cross, and when they threatened to raise complaints with Caesar--which they could have done, successfully, as he was not the best of governors--he backed down.  Writing "The King of the Jews" on his sign as the reason he was being executed appears to be one last, somewhat passive-aggressive, act of protest against their unfair execution they were forcing him into.