His response was probably a
bit more aggressive than necessary, but think about how many times he gets propositioned/pitched to per day.
Also, consider the venue: someone who comes up to you on the street and starts a conversation (especially in SF, I lived there for 7 years while working at startups) is likely asking for a handout, donation, trying to get you to sign a petition, trying to scam you, mentally ill, or some combination of the above. Someone who interrupts your conversation with another person on the street immediately comes across as rude regardless of their intentions.
There was probably no way you could have successfully engaged him in a conversation, even a very short one, at that chance encounter. It just wasn't a good set of circumstances.