Luke does not mention the incident at all. Judas thought the money should have been given to him for distribution to the poor. But John adds a note that he had observed Judas using donations for his own purposes. We need not assume that he was enriching himself personally, but he was putting the money for uses which Jesus would not have approved. Judas is typical of those who begin wanting to free their country and free the poor from poverty, but they soon become slaves of the very money that they collect.
Fund raising is always dangerous business.
But Jesus is pointing out that, when we are surrounded by vast human need, there is still a place for acts of extravagant devotion. Mary knew Jesus was about to be crucified, and she was right to express her devotion. And since the Gospels of Matthew and Mark are usually the first to be translated, there are hundreds of major languages and thousands of tribal languages continually announcing Mary's devotion throughout the world. Lazarus had been raised from the dead only a short while before so the crowds were still milling around. It was Passover time, and people came to Jerusalem early to get lodging and make preparations.