This post is entirely speculative, and nobody should take it as an argument for how or why things actually went down. It's just a possibility that I was thinking about this morning.
This speculation is all based on speculation about what Jesus' followers expected of him. From various things in the gospels, it looks like a lot of people didn't know what to make of Jesus at the beginning of his ministry, but as things progressed, his followers began to see him in more of a messianic light. Some were frustrated that he just didn't come right out and declare exactly who and what he was explicitly.
Jesus seemed to be more interested in showing people who he was and letting them draw their own conclusions than in making explicit claims about himself. This is less so in the gospel of John. In some cases, Jesus appeared to want to hide his true identity and only reveal it to those who were closest to him.
So I got to thinking about why Judas might've betrayed Jesus, especially after seeing Jesus' miracles. Before I go on, let me remind the reader that this is all entirely speculative. By the last week of Jesus' life, his claim to be a messiah (i.e. a king) had become pretty clear. The fact that he rode into Jerusalem during Passover week on a donkey with crowds shouting, "Hosanna to the son of David!" consciously acting out a messianic prophecy from Zechariah 9:9 made his intentions clear. This incident, along with the scene he made in the Temple, is probably what got Jesus arrested and tried for claiming to be "the king of the Jews."
If Jesus' messianic claim had become clear by this point, what did his followers expect to happen? It's easy to imagine that they expected Jesus to ride into Jerusalem and take the throne. While doing so, he'd surely overthrow the Roman occupation. One interesting fact is that one of Jesus' twelve apostles is identified as being from the Zealot party. This was a political party in the first century that wanted to use force to overthrow the Romans. It's interesting to speculate why a person like that would be following Jesus. What did he expect of Jesus? Did he retain his Zealot views the whole time he was following Jesus?
Well, maybe, if Simon the Zealot was expecting Jesus to initiate an armed revolt, he wasn't the only one. I mean look at the two disciples on the road to Emmaus after Jesus had been crucified. They were clearly disappointed about something. They said, "But we were hoping it was he who would redeem Israel." Since Jesus was crucified, they were disappointed to find that Jesus did not redeem Israel. What would "redeeming Israel" have meant? Perhaps an armed revolt. Even after Jesus rose from the dead, his disciples asked him, "Lord, is it at this time You are restoring the kingdom to Israel?" They were still expecting him to take the physical throne of David and establish national sovereignty, which surely would entail overthrowing the Romans.
I read a book earlier this year called Judaisms and Their Messiahs At the Turn of the Christian Era, edited by Jacob Neusner and two others. It's a collection of essays about various Jewish messianic expectations. There was a lot of diversity in beliefs about messiahs in Judaism, but I don't remember there being any where the kingly messiah was going to come peacefully and claim to have a kingdom that is "not of this world." For those who imagined a messiah in the sense of a Davidic king, they thought it would be an actual king on an actual physical throne over Israel. So it stands to reason that's what a lot of Jesus' followers expected, and they were disappointed when he was arrested and crucified.
So here's my speculation. There was a time in John's gospel when the people tried to make Jesus king by force, but Jesus avoided it by withdrawing to the mountains to be alone. Maybe what happened with Judas was that Judas hoped and expected Jesus to assert his authority and place himself on the throne of David. His expectations may have been especially high when Jesus rode into Jerusalem on a donkey. When it became clear to Judas over the following days that Jesus had no intention of taking the throne by force, Judas felt betrayed. This could have seriously angered him because he gave up everything to follow Jesus. So it could be that he betrayed Jesus out of furious anger, disappointment, and maybe even a little revenge. Maybe he felt like Jesus had misled them all.
I've heard some people speculate that Judas may have "betrayed" Jesus as a way of forcing the issue. If the authorities came to arrest Jesus, then Jesus would have to assert his dominance, and that would get things going. If that were the case, then Judas may have been the opposite of disappointed. He may have had a lot of faith in Jesus. But if he had enough faith in Jesus to pull a stunt like that, it's hard to imagine why he thought the stunt was necessary. Maybe he was just impatient.