That is a good use of money. But in this case, Mary had picked an even better use of the money. She used it in an act of tremendous devotion, an act of worship. That is a legitimate use of money, too. Some Christians make a religion out of social work, and they do very well.
Social work is part of the Christian faith.
But some unfortunately see that as the only form of religion, and they have forgotten about devotion to Jesus. Social work is good, but it is not supreme. It's a question of priorities, and Jesus must always be first. For Christian service to really count, it must be done for Christ. We are serving him.