Believe it or not I've got the EXACT same problem as you, for all my life throughout school i was usually depressed and althought i had a fairly large group of friends I was never as outgoing or determined as them.
and after highschool i just started drifting away, smoking pot, and always bein ashamed of myself, and it just kept getting worse and worse, I couldnt stand to see even my own picture, I always thought down on myself, and i was just hiding from it through getting high.
I think its because as long as I can remember i've been torturing myself over the fact i've never had anyone special in my life, and its really hard to think positive when theres nothing positive happening.
so I've decided to quit, and am considering anti-depressants, I took them when i was younger and they seemed to help.
Maybe this is an option for you too?
sorry, i easily get caught up in my own worries when the point is to help you.
you ask "what did I do to cause this". I think its because your self conscious, and have low self esteem, jus' like me .
I started thinking that all of my friends didnt like me because i didnt have a life of my own, and purposely avoided going to party's. and I avoided situations that would make me feel uncomfortable, But that didnt help at all, it made it worse because my thought pettern began eating away at who I really am.
but i've come to realize that im still very young and I cant continue to live my life in misery, its doesnt matter how many friends you have, or how much money you make.
What it all comes down to is being happy with yourself, cause thats really the only thing in your life you have complete control of. and when your happy with who you are, you won't ask "whats wrong with me, why don't i have many friends". You'll think things like "im a great person, and anyone who says otherwise can go to hell"
and the reason you think "I guess it's my personality that scares people away from me. No one likes to be around me" its your self consiousness that scares people away from you. if you always think negative things, people will only see negative things.
take some time to reflect on your life and was it always this way?
For me that helped alot cause there have been times in the past when I was happy, but my depression has taken over a large part of my time.
I still struggle with myself, and very easily get into a depressed mood
I could type on and on for hours because all i really do is think about "why?".
I hope my story has helped give you some insight on your problem, and if you ever need someone to talk to, just give me a PM.
good luck