Younger and less mature girls tend to be more interested in exciting/attractive guys. They want a guy to thrill and excite them and don't care too much about anything else. They think about the short term. Ooh this guy is so exciting and manly blah blah. I know he's a jerk sometimes but aww he's also so sweet. I just need to change him a little, you know, fix him up! It's some strange crusade less mature girls embark on. Girls can be retarded, that's for sure - but it's not all their fault.
If you get friended chances are she just doesn't find you too good looking, you act like a chick, or you're just too damn nice.
If you give the girl you're all when you're just friends she doesn't really have a reason to date you. She can screw other dudes on the side and still rely on you. You can't let her do that. It can be tough, but you basically need to be a tiny bit of a douche. Not a jerk, but don't ALWAYS be there. Basically just don't let her walk all over you. Show her you have your own life and if she wants to get special attention then she needs to be more than you friend.
Both are to blame. Some immature girls just don't realize what the nicer/less exciting guys can offer them. Some guys treat every girl like a princess and leave them no reason to want to date you because they can get everything they want just from being your friend. In other cases the girl just doesn't find you good looking and maybe you're not, or maybe she just has different physical preferences. Nothing you can do about that one.