I've been homeless.
For most of my life I was fairly generous, though I'd take a person to a diner rather than give money, or to Goodwill if clothes were needed. Then I went through it myself, and learned a lot.
Yes, many homeless are mentally ill. I knew two who were on the street because they lost everything they owned -- business, home, car -- because of being arrested and forced to get an attorney, then after being found innocent still had to deal with many thousands of dollars in legal costs; out of work beccause of time spent sitting in jail, they couldn't pay bills if they were going to pay the attorney... and it all went downhill due to our "justice" system. I knew one who had a $35,000 boat he had up and down the river, who had $100,000 in the bank; he had some strange disorder that left him unable to cope with all the straight lines of building and streets. Another I met had around $200,000 in the bank, and was homeless because he said he just got plain tired of doing house chores. A "bag lady" I spent some time with had lost her apartment when the building was sold, and thanks to lacking all sorts of required paperwork couldn't get another. Others are drug users who have lost everything by doing drugs.
So, being homeless, I learned to be doubtful when asked for money, because it's hard to tell the ones who need help from those who don't.
Then I got robbed of over $800 of gear by homeless people. Now I don't give a thing. I figure that given the amounts I've given in the past, I've rarely given more than $50 a year to the homeless, so in 16 years I'll have recovered the money homeless people cost me, and maybe I'll start giving again.
And meanwhile I'm still recovering from my own homeless spell. I tried not to use it, but sometimes there are things that just have to be had, and I used my VISA -- it's still got a balance in the mid four-figures. Also meanwhile, I bum housing from people -- so though I'm not technically "homeless", I have no home.