At the end of Act Two when John prompts her to tell the courts about the poppet, she expresses her true fear that "[Abby'll] kill me for sayin' that!...I cannot, they'll turn on me!" She is terrified that if she charges Abby with staging Elizabeth's accusation, the girls will turn on her and accuse her of being a witch. In the end, this is the true motive behind her actions.
However, she stays home with John for a week, "strivin' with her soul" and finally gathers the courage to come to the courts and tell them that the girls are pretending. She seems truly motivated to tell the truth. She tells them, "It were pretense, sir...I cannot lie no more. I am with God." Unfortunately, her desire to tell the truth is soon overwhelmed by her fear of the girls who start claiming she has entered the room as a bird and is threatening to tear their eyes out. Danforth believes them, so Mary caves. She finally turns on John and calls him a "Devil's man" who had forced her to come lie to the courts. So, when all is said an done, her motives were self-preservation over her desire to be true.