Like anything else it can be done well or it can be done poorly, but one thing I love is when a song created for and inextricably associated with one movie is used in another movie in a completely different context. It’s cute when it’s done for the in-joke alone, like when the Star Trek fight theme pops up in The Cable Guy, but I’m thinking of a more complete repurposing, like the use of the Goldfinger theme in Little Voice (starts around 4:25). The use of “Singin’ in the Rain” in A Clockwork Orange might be another example, but the less said about that the better.
One of my favorite examples is from Punch-Drunk Love, in which a key extended scene of the movie (obvious warning: plot spoilers in the link) is set to Shelley Duvall’s song “He Needs Me” from Popeye.
It’s trickier with instrumentals–I mean, Prokofiev’s Lieutenant Kijé Suite was composed for the 1934 Soviet film Lieutenant Kijé, but you don’t need to have seen it (and few in the West ever did) to appreciate the way the music was used in The Horse’s Mouth or Love and Death. But if you hear John Williams’s Imperial March from Star Wars in any context you get the reference.
What are some of your favorite examples of repurposed movie songs?