What does John 13:20 mean?
It's possible to read this verse and find it out of place. Seen from the right perspective however, it's a bridge between two sections of this passage. After speaking of His example of humble servanthood (John 13:12–16), Jesus has hinted that someone in His inner circle will betray Him (John 13:17–19).This statement reiterates the idea that the gospel is God's message, carried by people. It's entirely true that we can put unnecessary barriers in other peoples' spiritual path (2 Corinthians 6:3). Such things aside, those who reject the gospel itself are rejecting God, and those who accept it are accepting Him (John 17:8). When someone hears the gospel, their response to it is not—primarily—a response to the person from whom they hear it. It's the hearer either embracing or ignoring the voice of the Holy Spirit (Acts 7:51; Matthew 10:14).
In the same sense, those who listen to the gospel preaching of a true believer are listening to Christ; to listen to Christ is to listen to God. That message is true, even though there are those who falsely claim the name of Christ, or who reject His truth in favor of their own desires.
That establishes the connection between this statement, the prior verses, and the passage which follows. Judas is not a true follower of Christ. And yet, he was chosen for his role by Jesus. That does not change the fact that Jesus chose, sent, and empowered the other disciples. Judas' betrayal does not make the witness of Peter, or Andrew, or Thomas invalid. The sin of some scandalized believer does not undo the truth proclaimed by millions of others.
This does, however, make Judas' rejection of Christ that much more tragic. Despite all the miracles and sermons he witnessed, Judas has already chosen damnation (Mark 14:18–21). In the following passage, Jesus begins to express the powerful human emotions that come with being betrayed. Among those, probably, is sorrow at knowing how painful this news will be to the rest of the inner circle.