1. You didn't make your intentions clear
So you like a girl? Instead of spending time with her, being flirty, or taking her to a movie date- you spend your time just staring at the back of her head in class. You will talk to her occasionally and wish that she was your woman, but you never make you intentions clear. If you've been spending time with her, tell her that you like her and would like to get to know her. No use in beating around the bush.
2. You act like you don't care, but you do
In order to act "cool" and not scare her off, you act like you don't care if she dates other guys, or the fact that she wasn't able to spend Friday night with you. You pretend like it's fine, and she thinks that it is ok- because you have no interest in her as a more than a friend, and therefore she moves on.
3. You are too nice
She treats you like her girlfriend? Or she walk all over your feelings? It is ok, because as her best buddy you have assumed the role of the guy in the side supporting her, while being mr. nice guy. There is difference between being a nice guy and being a welcome mat that gets walked all over.