“Men are afraid that women will laugh at them. Women are afraid that men will kill them.” — Margaret Atwood. This isn’t an irrational fear from women either. It’s not rare for them to be assaulted for ignoring or denying advances from strangers.
Can you see how these these encounters can be way more loaded and dangerous than having a chat with a stranger? She was in a vulnerable position to be asked these questions from someone who she has no idea how he will react.
Also, to your “How do you know any of this when you didn’t give him a chance?” remark. He’s not entitled to a chance. That’s not something he deserves for complimenting her bookbag. She was nice enough to give him benefit of the doubt but he crossed the line when he asked about her private life.