There are many qualities that determine whether a given song is considered 'good' by one or more people, and obviously the designation is quite subjective. I'm sure many people have studied and thought about this from scientific, philosophical, and social points of view far more than I have, and perhaps I'll try to learn about some of those at some point. However, an idea just popped into my head and I wanted to get it written down before I forgot about it. I think the following makes sense, based on at least three minutes of semi-distracted consideration.
Part of what leads you to think a song is good is that having heard some portion of it, you feel you could have predicted what follows, but you didn't.
There must be many caveats I haven't yet thought about, and one or two issues that do seem obvious -- for example, a song's being too predictable is often what leads it to be boring. I think that's why it's important that you don't actually predict it, you only feel as if you could have after you've heard it.