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 Jesus, 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. (Jn 12:1-11)
Judas said that the money wasted on the perfumed oil could have saved and given to the poor. It was a man’s one year (300 days) salary. Certainly the ointment was expensive. Concern of Judas could have been also real but the author gave the motivation for his statement. Even good statements could have wrong motivation. Judas was seeing it from earthy (this worldly) and selfish perspective.
Jesus said to allow her to do according her plan. In whatever she did, though for different motivation, she revealed a divine plan. Jesus was able to see that she had a purpose in her doing and it was with regard to his death and burial. The motivation of Mary was, though earthy, it had something to do with Jesus and his burial. Her motivation was not purely selfish.
Jesus said: ‘You always have the poor with you, but you do not always have me’. Jesus looked at the situation from the other worldly perspective. Jesus said you will not have me always with you. He looked at the present situation with his resurrection perspective. After his resurrection (in the other world) there would not be any more poor. Resurrection gave colour to the situation and changed the perspective. Jesus told his people to look at the situation with resurrection perspective and live the present life in that perspective.