Six days before Passover Jesus came to Bethany, where Lazarus was, whom Jesus had raised from the dead. They gave a dinner for him there, and Martha served, while Lazarus was one of those reclining at table with him. Mary took a liter of costly perfumed oil made from genuine aromatic nard and anointed the feet of Jesus and dried them with her hair; the house was filled with the fragrance of the oil. Then Judas the Iscariot, one of his disciples, and the one who would betray him, said, “Why was this oil not sold for three hundred days' wages and given to the poor?”
He said this not because he cared about the poor but because he was a thief and held the money bag and used to steal the contributions. So Jesus said, “Leave her alone. Let her keep this for the day of my burial. You always have the poor with you, but you do not always have me.”
The large crowd of the Jews found out that he was there and came, not only because of him, but also to see Lazarus, whom he had raised from the dead. And the chief priests plotted to kill Lazarus too, because many of the Jews were turning away and believing in Jesus because of him.
Our Lord then said to Judas, "That which you do, do quickly," and the traitor this once obeyed his Master. For having received the sop, he started immediately on his work: "He then having received the sop, went immediately out." And indeed he did go out, not only from the house in which he was, but from Jesus altogether. It would seem that Satan, after he had entered into Judas, could not bear to be in the same place with Jesus: for there is no agreement between Jesus and Satan. Nor is it idle inquiring why after he had received the sop, it is not added, that he ate it. Why did not Judas eat the bread, after he received it? Perhaps because, as soon as he had received it, the devil, who had put it into his heart to betray Christ, fearful that the bread, if eaten, might drive out what he had put in, entered into him, so that he went out immediately before he ate it. And it may be useful to remark, that as he who eats our Lord's bread and drinks His cup unworthily, eats and drinks to his own damnation (1 Cor 11:29); so the bread which Jesus gave him was eaten by the rest to their salvation, but by Judas to his damnation, inasmuch as after it the devil entered into him. With this, the time of night corresponded with the night which overspread the soul of Judas.
Catena Aurea (St. Thomas Aquinas)
Commentary on John, Book 16 (Origen)