John Paul II knew of sexually abusive priests, and he did not stop them. Yet he is now a saint. How is that possible?
First of all, we don't know when John Paul II became fully aware of the extent of the problem of priests committing sexual abuse. Keep in mind that it is unlikely that a pope could know immediately of abusive priests in local Christian communities. The person most directly responsible for the oversight of priests is the bishop of a diocese or the religious superior of the community to which a priest belongs. If the superior does not report the problem up to the pope, the pope can't be held personally responsible for what he does not know.
That said, in the early 2000s, after the exposé of the clergy abuse crisis in the United States, we know that John Paul II certainly knew there was a problem. In the early days of the crisis, there were reports that the Vatican was slow to respond, but we also know that John Paul eventually put then-Cardinal Joseph Ratzinger, prefect of the Congregation for the Doctrine of the Faith, in charge of expediting the laicization of abusive priests and reforming Church law so that bishops were held responsible for failure to act appropriately in response to abuse cases.
As for how John Paul II could be canonized, two things: One, his cause was investigated by the Congregation for the Causes of Saints, and his record on the abuse scandal undoubtedly was scrutinized before his cause progressed. Second, failures of prudence and even personal sin do not necessarily impede a person from being named a saint. Servant of God Dorothy Day once said, "I have since heard a priest friend of ours remark gloomily that one could go to hell imitating the imperfections of the saints."
For more information, I recommend my article The Imperfections of the Saints.