Yelled at a Rude Homeless Man in Church. Was I wrong?

You’re right. No one knows for sure that this man was mentally ill. If he is mentally ill, part of mental illness may present as hostility and limited social skills. It is not an excuse for his behavior, just a reason. He may have been agitated because he hasn’t eaten for days prior to today , and has no idea when he’ll eat again. As one poster said already , learn from this experience. And to answer your other question, yes it was rude and wrong to behave that way, especially in a church.