It means, he thinks you are ugly, kinda obvious lol. What you do, is not give an f about what a dude says. If other people have said you are pretty, an opinion of one person should not even matter to you. In fact, I'm surprised you would even let this get to you lol.
It is possible, to him, you are not attractive. No one is considered attractive to 100% of the population, so even if many guys think you're beautiful, there will be some who don't think you are. Just don't worry about what they think.
I don't know you, and you have a cartoon as your profile picture so I can't judge on how you look. So I have to guess on what's going on here.. If you are good looking maybe even gorgeous, gorgeous women tend to be conceded. Some have real attitude and to some that is unattractive. And if you treat people bad because you consider them beneath you (again I'm guessing, I don't know you. And I'm not saying you are...) that would make you an ugly person INSIDE...
Was this guy a boyfriend or a friend or just some random guy. For him to say that is rude you don't just say something like that to someone if it he meant it as a joke you should ask him why he said that.
If other people say you are gorgeous, and you feel beautiful, then don't sweat it. Why did he say it? Because he's very rude. I doubt very much that he thinks you are ugly. He's probably jealous of you or something. Don't give it another thought.
I think sometimes guys say that to a girl ( at least I remember it from grade school days) because they were playing games. Maybe he said it to see your reaction and to see if it made you angry? Maybe he is mad at you for something he thinks you did? or maybe he is saying the opposite of what he really thinks.