The Hackers soundtrack made more money than the actual movie. There was a sequel to the soundtrack but not the movie and unless you are involved in development, almost nobody knows the movie but you still hear songs from the soundtracks at nightclubs today.
I'm having trouble coming up with an example, but my dad told me that "Warsaw Concerto" was composed for the movie "Dangerous Moonlight". The movie was bad, but was popular because people really liked "Warsaw Concerto".
I could probably be proved wrong( I don’t think it’s entirely causal but more “they won’t pay for good music if they won’t pay for a good script” kind of thing.
That said, I would absolutely buy (and wear) a Xanadu jacket if I saw one for a reasonable price.