No, you're definitely not ugly--far from it, in fact! I've actually noticed that I've been put in similar situations, as have tons of my friends. My theory is that it has more to do with behavior than looks.
Think about it: how do you act around girls you're interested in? Naturally, you want to impress them; to conceal your bad qualities and make it seem like you're their ideal man. But in doing this, you're also losing a dimension of your personality. Part of what makes people charming are their quirks: their random hobbies, strange mannerisms, or unique beliefs. But when trying to attract someone most of us try to conceal these quirks, because we think that anything out of the ordinary could act as a turn-off. So, in a sense, we become plastic. We put on masks and morph into fake versions of ourselves in the hopes that we can conform to a perfect standard. This makes us less objectionable, but also less relatable.
Now think about the girls you aren't interested in; the ones you don't want to impress. There's no need to act fake around them, because you aren't as concerned about what they think of you. You're more willing to reveal your flaws, and in so doing, to reveal yourself as a 3-dimensional human being. Now your quirks are fully exposed. True, there will be people who are put off by them and don't like them. But there will also be the girls who find them cute, attractive or charming, and become interested in you as a result.
Basically, humans as a speicies are drawn to people that we can relate to. But our fundamental mistake is that we naturally assume the opposite: that people like perfection, and will reject us for what can be percieved as flaws.
In a sense, trying to impress people is inherently unimpressive. While they may admire us for it, they can't possibly relate to a 'perfect' person in the same way as a 'real' person.
Yes, showing what we think of as the negative aspects of our personality can be risky. People may not like us for it, and may even be turned-off because of it. But when we show people our 'realness', we also give them more opportunities to find those quirks that they'll ultimately be drawn to.
In short: it's much harder to attract people when you work hard at impressing them. As cliche as it sounds, the best thing to do is to be yourself.
(This might also be why you're not interested in the girls who like you (assuming that it's not just a matter of physical attraction). Are they trying to be real, or impressive?)
Haha, sorry for the essay! I didn't think this would turn out to be so long. I hope it helps! :)