There's been volumes of study on the subject over the past few hundred years. The answer is the body of knowledge known as "music appreciation" or "music science" or various other terms. You can get a college degree in this stuff if you really want to.
Short version:
Good music is, well, musical. Good music has all the elements of music that differentiate music from random noise: melody, harmony, rhythm, structure, temp, emotion, and a handful of other elements. When many of these elements are present and used to good effect in a particular song, the results are a song that has appeal as really good music. I
The Beatles were masters at creating songs that were utterly musical. They understood all of the elements of good music, how they interact together, and how to include all of them in their songs. The obvious result is that most of their music stands favorably against the best music every created by man. Most of the classical masters were similarly well-versed in the science of music and were expert practitioners of the art. That's why you don['t find many duds from the likes of Beethoven or Tchaikovsky.
Most modern bands don't incorporate these elements into their songs. Some notable exceptions (in my opinion) are Linkin Park, Tool, Evanescence. Music from these bands is atypically musical, usually includes at minimum good melody, good rhythm, and good tempo.
Pop music tends to be 9 parts marketing and only 1 part actual music. Rock tunes always have rhythm (boring and unoriginal rhythm, but rhythm nonetheless). But rhythm alone isn't usually enough to carry a tune, unless it is spectacularly good rhythm. Melody is probably the most important musical element for making a good song, and it can carry a tune all on it's own. But good melody is conspicuously absent in most pop music.
I'm starting to ramble. Anyways...
Learn to identify the elements of music (melody, harmony, etc). They're fairly hard concepts to grasp properly. At least that's what I've found. If you do learn what these concepts are and how to identify them in the songs you hear, then i bet you'll understand the difference between Saturday in the Park and Layla vs Beginnings and Keep on Growing.