Judas left immediately. He could no longer stay. Why did Judas leave?
Jesus warned the disciples that one of the twelve was a traitor. Judas could not risk staying if the disciples found out it was him.
Jesus always knew he was the traitor, and now Judas knew that Jesus knew it was him.
Jesus had exposed Judas as the traitor. Even though not all of the disciples understood, Jesus identified Judas as the traitor. John heard, and some of the others might have heard too. Peter was already asking who the traitor was and it was just a matter of time before all of them would know.
Satan entered Judas and he could not continue to stay in Jesus presence.
Judas had to go to the Jewish leaders before Jesus could disappear. If that happened and he could not deliver on his promise, he would have been ruined.