Interesting question because it may impact the idea of a water baptism regeneration that some have taught for centuries. To be clear, prior to Christ's resurrection, they had only gone through the baptism of repentance.
Anyway, the Lord and disciples are at the meal; Judas Isacariat is present. Jesus gets up, washes their feet, returns to the meal, announces that one will betray Him, dips the bread, and hands it to Judas.
The OP asks, why wash Judas' feet?
Jesus replied, "The one who has bathed needs only to wash his feet, but is completely clean. And you disciples are clean, but not every one of you."
In other words, they had been baptized (cleansed), but either Judas had not been baptized by John or had been, but to no effect. Washing feet would not cleanse him, nor would eating the bread bring him to the kingdom.
As another mentioned, there was also the lesson of humility, of service to be taught and learned.