I am going to assume you are not asking this metaphorically but quite literally.
Well, I have been in similar situations (both, walking by and being walked by). They usually don't want awkward scenarios. In majority of the cases that's what it is. Also, sometimes when someone has a crush on you the person is nervous to say something stupid and make a joke out of himself (hence leaving a negative impression in your mind). This is true for the opposite gender of course.
Otherwise, I have seen many people who do it to show a little attitude which they believe is healthy. They think having your own space and not being a doll Like girls ignore one another to make the other think they are not worthy of being greeted or even noticed for that matter. For guys, who are usually more down to earth in such cases, a few believe they don't know you that well (even if they actually do) to especially drop by and say hi just for the sake of it. Mostly such people would normally talk to you if it becomes necessary.
For me, it's more of a friends thing to go up to people to greet them, wave, smile, say hello and keep walking etc. If people, whom you know not as much as your friends, stop by and give attention to you, they might as well give the same attention to everyone else. Which is kinda tough.
Lastly, I simply walk past people who are either already talking to someone else, or simply not looking like they're in the mood to acknowledge my existence lol
So you should make sure you don't come across that way. If it's a chick you might as well smile and observe her casually as she walks past you. That way, she's bound to respond in some way or the other.
Hope this helped.