Legally - No you do not deserve to be raped. You are quite entitled to to walk home in any way, at any time in any state you want to. You should not come to any harm
Legally, if any harm comes to this girl she then holds the right to inform the police and the person who steps all over her rights should be brought to answer for his/her actions.
To cower and give up our rights in the face of pressure is like saying that girl shouldn't have the right to drink, wear miniskirts or walk herself home because it may cause someone to rape her.
"Go ahead, search me... maybe I have a bomb!" Innocent until proven guilty isn't it?
Should we really give up our right to privacy because some people do bad things?
It is like an elementary school teacher keeping the whole class in for recess because one kid said a bad word.
Don't punish the masses because of the actions of the few.