I know it's a trope and everything, but it's entirely possible to realize something like this like ten years later after the fact. You think flirting is just jokes, invitations to do stuff is just stuff, and weird looks are just them being weird.
This kind of thing happens all the time because your homely friend isn't just not hot, but genuinely not that attractive, whether they're fat or acne-ridden or snaggletoothed or really plain in the face without makeup. And of course you're going to pursue a hot girl who shows a modicum of interest in you above a girl who would probably worship your dick but do it with weird teeth and three layers from Hot Topic.