You know, I think it has something to do with the nature of the writing, not merely its quality.
This is a pretty big generalization, but I’d say that there are really two flavors of dialogue that can be written for a movie or stage play:
The first, and more common, is dialogue written purely in the service of some larger aspect of the work. A given line needs to accomplish a task: maybe it needs to advance the plot, maybe it needs to illuminate a particular character or provide a particular actor with an opportunity to shine. Most dialogue writing is like this. It’s doesn’t mean that it’s bad, by any stretch of the imagination, but it mostly means that it isn’t memorable. Frasier was, by and large, a skillfully written sitcom, but the dialogue was generally intended to advance the episode and series plots and provide a framework on which to hang the acting talents of the cast. Even if you watched Frasier religiously, how many individual lines do you remember? Probably not many, because none of them were memorable of themselves; even dialogue like this *is *memorable, it is because they were made memorable by the context and manner in which they were delivered. There’s nothing inherently brilliant about the words, “I’ll be back,” but they are memorable in their most famous context *because of * their context.
The other kind of writing is the kind where the dialogue is written in such a way that the specific language in and of itself is part of the point. It’s dialogue as literature, even as poetry. Think of the lines in The Princess Bride. Very nearly every line of dialogue is utterly unique purely as language. The word choice, sentence structure, and avoidance of the cliche make that dialogue interesting even apart from the plot and the actors delivering it. I mean, think about it, even setting aside the most famous lines from the movie, there’s:
“In my day, television was called books.”
“So. It is down to you, and it is down to me.”
“Tyrone, you know how much I love watching you work, but I’ve got my country’s 500th anniversary to plan, my wedding to arrange, my wife to murder and Guilder to frame for it; I’m swamped.”
“Have fun storming the castle!”
“Your ears you keep and I’ll tell you why. So that every shriek of every child at seeing your hideousness will be yours to cherish. Every babe that weeps at your approach, every woman who cries out, “Dear God! What is that thing,” will echo in your perfect ears.”
Every one of those lines is of value in and of itself. None depend on the inflection of the actor - oh, Falk and Shawn and Sarandon and Crystal and Elwes add something to each one, to be sure, but if you just put any one of those sentences on a piece of paper and handed it to a person who’s never seen The Princess Bride, the language of itself would have an impact on them. None of the lines are cliches; none of them are sentences you’d ever heard before.
Watch a lesser film sometime, and count how many lines are stuffed in there just to move the plot, or reveal something about the character, and how many of them are stock phrases that can be plugged into any movie - “We need to get going.” “I’m not going in there.” “[Character name] is going to kill me.” Now watch Bride and see how few could be described in this way. The dialogue is always about finding a true but unique way to say something.
Thus, since the particular language is unique and was created to have intrinsic value as language, you remember it outside of its original context more readily.
(I really like that movie).