Think of it this way: if you needed help with something, you’d probably ask for the support of someone who has had personal experience with the issue in question. This is the idea behind patron saints – why John the Evangelist is a patron saint of writers, say, or why Joan of Arc is one of the patron saints of soldiers.
When it comes to sexual purity (I’m assuming that’s the type of purity you’re referencing here), Mary is a logical intercessor. Church teaching states that she was a virgin not just at the time of Christ’s conception, but that she remained a virgin her whole life. The National Conference of Catholic Bishops, in their pastoral letter Behold Your Mother: Woman of Faith, put it this way:
“God called Mary and Joseph to sublimate the consummation of their married love in exclusive dedication to the holy Child, conceived not by a human father but by the Holy Spirit.”
So if we believe that Mary was a virgin her entire life, we can figure that she knows a thing or two about purity, and that her prayers will help us as we handle moments of sexual temptation. (Come to think of it, St. Joseph might be a pretty good intercessor in this area, too.)