Giving to charity does not guarantee that your money will go directly towards helping the homeless or improving your local community.
By giving directly to a person in need, you eliminate the possibility of your money being used by a corrupt charity. You also eliminate the possibility of big-name charities receiving a surplus of money.
Charities are tax-exempt, so charities can worsen social inequalities. Letting charities be tax-exempt reduces the revenue available for government social programs which are held more accountable than charities.
Vocally giving to charity is a form of virtue signaling. Vocal giving (which many charities encourage to further their reach) shows others in your own social circle that you care for the homeless. Yet, you only do so to receive praise. While such action may benefit the homeless somehow, you are still treating people who are homeless with contempt, using them as a means to a selfish end: to boost your social standing.