In addition to her character and the role she plays in terms of the plot, I think the importance of her role as a symbol is even more significant. Mary realizes the truth—that there are not witches in Salem attempting to topple religion—around the end of act 2, when she learns of Abigail's story regarding the poppet. Then, she goes with her employer, John Proctor, and two other men, Giles Corey and Francis Nurse, to the court to present her new testimony: namely, that Abigail and the other girls are lying to the court and that she, herself, was mistaken when she thought she felt and saw the effects of witches earlier. Proctor compels her, despite her fear of Abigail, to take the moral high ground.
However, once her own life is in jeopardy, when the girls accuse her of sending a cold wind to freeze them or sending out her spirit as a yellow bird that wants to "tear [Abigail's] face" (witchcraft, in essence), Mary begins to lie in earnest. She accuses Proctor of being "the Devil's man" and says that she will "go [his] way no more," that she "love[s] God." She tells a further lie, that he tried to persuade her to "go and overthrow the court," a line she is, I'm sure, well aware will satisfy Deputy Governor Danforth of Proctor's guilt and her own honesty. Thus, she comes to represent the kind of person who is willing to stand up to injustice, but only until her own safety is threatened; she stands in for the kind of person who believes in justice, but only so far as it does not endanger her own self.