Most Protestants don’t believe that you have to be “sinless” or “perfect” to go to heaven.
They believe that JESUS’s perfection will become a believer’s perfection. They believe that when you die, it doesn’t matter what sins you have done. Jesus has not only forgiven them all, but covered them all. God sees JESUS, not you, and so you go to heaven.
(This belief is sometimes called the “snow-covered dunghill,” based on one of Martin Luther’s illustrations).
Catholics don’t believe this, of course. We believe that sin cannot enter heaven, and so we must become more and more like Christ until we are no longer sinful before we can enter heaven.
We believe that if this "becoming like Christ) doesn’t happen on earth, it will happen in purgatory, where our sins will be “burned away” and we will be made perfect, like Christ.
Yu can see why Protestants thinks that Catholics believe in “salvation by works.” They think that we are striving in our own strength and humanity to be “perfect” and “sinless.”
They don’t think that perfection is a requirement to enter heaven (even though the Bible says so).
Of course, Catholics don’t believe that we are capable of being perfect in our own human strength. We believe that ALL our goodness comes through the grace of God. We can do NOTHING apart from Him.
Catholics believe that human beings can grow in Christ to the point where we no longer sin and are like Christ. The Bible tells us this.
But Protestants don’t believe this. They believe that we can never be perfect or sin-free here on this earth, even though the Bible says that we can and should be perfect.
This is an example of where Protestants don’t really take the Bible literally, even though they say they do.
The Protestant who made the joke about the Pope was criticizing the “doctrine of works” that they think Catholics believe in. The joke is that if the Pope can’t “achieve” good works, then regular Catholics have no chance.
They are trying to convince you and others to abandon the “works” salvation and instead, embrace the “free gift of salvation” in which you aren’t expected to become perfect or sinless. All you have to do is believe in Jesus and let HIS good works cover up your sins and get you into heaven. (Catholics believe that this is a “selective” reading of the Bible, leaving out all the many verses about “working out your salvation” and “justified by works, not faith alone,” and “be perfect,” etc.)