I would present this as "some people are not able to do things we think are ordinary." By now he has presumably met or seen or heard of someone who cannot walk, or who cannot see or hear. Some are born with a disability, some acquire it through disease or accident. And our society does what it can to help - ramps next to stairs, sign language interpreters, and so on.
In the same way, some people cannot follow our rules about behaving well. It's not that they don't want to, or can't be bothered, they can't do it. And in the long run that can lead to not being able to work, or to live with other people. It's really sad. There are some things we as a society do to help, but they don't all work. Some people try to help by giving money for food; some people think that doesn't really help. It's complicated.
[Yes, some people end up homeless when there is nothing wrong with them through sheer bad luck - a layoff with no support network to help you, that sort of thing. I believe that is less common in Vancouver than in some other places. But some stay homeless and some do not, and some of that is about their mental state - even if being homeless caused that mental state. For explaining to a child, focusing on bad luck or bad decisions in the explanation strikes me as unfair and either blaming the homeless person or worrying the child that this could be their future. I would avoid both even if that meant glossing over some possible explanations of how this person ended up in this situation.]
The one thing to avoid here is some sort of logic that connects your child's occasional transgressions (like being loud in the grocery store or not sharing nicely) with the fate of the clearly crazy homeless guy begging for money. To that end you might want to emphasize the biological and nonvoluntary aspects of mental illness a little more than the actual facts of the matter would support. I think also 4 is too young to mention the role that substance abuse may play. (Besides, that's complicated. A childhood friend of mine ended up homeless and schizophrenic after a lot of substance abuse and it seems in hindsight that the glue etc was self medication for how his illness made him feel more than it was the cause of it.)
I would do my best to take a tone of "these are people who need help but we might not be the people to help" and not "these are scary people, stay away from them, and pray you don't end up like them" especially to a 4 year old. Most homeless people would never hurt anyone, much less a child. They make us uncomfortable because we can't be sure, but they are not a clear and obvious threat at all.
As for why he retells the story, here is someone clearly breaking the rules. He knows you don't just talk to people in a restaurant and ask them for stuff. He knows you are supposed to wear shoes or that you don't wear a winter coat in the summer. He knows adults follow the rules and he probably thinks all adults are interchangeable. Yet here is an adult, one who should know better, who is breaking a ton of rules. Why? IS that an option? That's why I think a suitable-for-4 explanation is that the person simply cannot follow the rules, just as some people cannot walk. You can acknowledge which societal norms are being broken and reaffirm your commitment to those norms, while at the same time talking about how to help people who have a problem, to the limit of your abilities. (You wouldn't try to set a broken leg on the street but you might help change a stranger's flat tire.)