It was because they loved Jesus. They had been delivered from their sins and their pasts by Jesus, and they were determined to stay with him until the end, as ugly as it was. Can you even imagine what it meant for these women to stay there throughout the whole crucifixion?
Mary Magdalene was there. We know that Jesus had delivered her from seven demons. There have been some scurrilous writings and suggestions that Jesus had a romantic relationship with Mary Magdalene. This is a lie and totally unsubstantiated by Scripture or history. For sure, this woman had deep feelings for Jesus because he had saved her from her past—and it was an awful past!
Can you fully comprehend being possessed by seven demons? No doubt she had been abused and suffered great harm from these demons for many years. No doubt she had once been full of guilt and gloom and despair, fearing she would live all her days possessed by these demons.
Then she met Jesus! In Mark 16, we read that Jesus had driven out those demons. However he did that, it must have been dramatic, perhaps painful, but it was no doubt the best day of her life! She was set free from her past, her guilt, and her shame.
Because Jesus is risen from the dead, he is able to do the same for you today. It may not be demons you are dealing with, but whatever it is in your past that haunts you, Jesus is a qualified Savior because he is risen from the dead. He can deliver you, too!