It's a joke. And not a very funny one. It is saying "if you took a sentence out of context, it sounds dirty."
When you hear someone say "that's what she said," you need to think back to the sentence that came _right before it_. Then you need to imagine that a woman is saying that sentence to a man while they are intimately involved. (Depending on the sentence and the audience, you may also be implying that *you* are the man who is being told the sentence or that your friend is the man who is hearing the sentence. That way, it could be a good-natured, kind of funny insult.)