"Why is this funny?" may be one of the hardest questions to answer. Humor is subjective, circumstantial, and, not infrequently, ineffable.
Personally, I don't think I'd ever encountered a nun joke before this, as I didn't grow up in a community with many Catholics and nuns didn't really seem relevant to our lives. Thus, like OP, I would never have understood the joke by myself.
The other answers show that an understanding of the joke requires some basic cultural assumptions - here, that nuns are secretly lewd (and sometimes, apparently, lesbian).
When the one nun asks, "Where's the soap?", the other takes this as a declarative comment about her current (apparently masturbatory) use of the soap: "Wears [out] the soap." The guilty nun then affirms that "Yes, it does, rather."
Why do some people find this funny? Because they already have a history of finding sexualized nuns funny, and this joke triggers their comic affection for that idea.
There are innumerable jokes that similarly necessitate some level of preconceived notion for their humor to be apparent. Let's look, for instance, at this "dumb blonde" joke:
The waiter asked the blonde if she would like her pizza cut into
six pieces or twelve.
"Six, please," she said. "I could never eat twelve!"
Why is this funny (to the extent that it is)? Because its audience has been programmed (probably from a young age) to find the idea that blondes are stupid funny. The joke itself doesn't much matter in its details - it just has to trigger that automatic comic response.
Examples abound - jokes about how Jewish/Asian/[insert modifier here] men have small penises, jokes about how "you might be a redneck if...", and on and on. Ultimately, they're contextual, and no amount of explaining the context will make the joke funny (even if it makes it decipherable).