What is going on here with Mary? We know in John12:1-8 that Jesus, Mary, Martha, Lazarus and Judas had gathered together for a meal. We are reminded that Jesus’ delay in arriving before Lazarus’ death and burial resulted in considerable anguish and grief that even caused Jesus himself to weep. There is no other family in any of the Gospels that I am aware of with whom Jesus is so closely connected.
As a household that had connections with the “elites” in Jerusalem, Mary would have been very aware of the plans underway to have Jesus arrested and executed. And she would have known that the form of execution would be crucifixion by the Romans, since that was the method used when the intention was to not just kill a person but to kill what they stood for; to kill basis of their faith, and to kill any possible continuing movement by followers. That form of death did not allow for a proper burial with the proper anointing of the body. Often the bodies of the crucified were left on the cross for scavenging birds and animals to eat the flesh, with the remains later thrown into a pit.
So, Jesus says, "Leave her alone. She bought (the perfume) for the day of my burial" (John 12:7)…and we knew, as did Mary, that there would be no proper burial. So now is the time for the anointing.
Yes, Mary exceeded cultural norms and exhibited incredible extravagance. Aside from the perfume being valued as comparable to a laborer’s yearly wages, the image of Jesus’ imminent death makes Mary’s unusual behavior quite appropriate for the occasion. Maybe there was nothing else for her to do? Perhaps sensing his impending death, all that was left for her to do was to kneel before Jesus and anoint his feet, and wipe them with her hair…. “If that was the case, she was doing then what we all too often wish we had thought to do. She wasn't waiting for him to die to acknowledge the gift he had already been. She was pouring it all out right then.”