I'm not sure homelessness is safer for men. Men are a lot more likely to be victims of every kind of assault than rape, and I have no reason to believe that the ratio of male:female victimization is affected by poverty. Further, men probably don't lag women a whole lot in rape victimization, or at least it's certainly more prevalent than the cultural meme suggests, largely due to underreporting and the fact that many jurisdictions (including the FBI) have defined rape in such a way that it excludes men from the victimization statistics (e.g. "rape is vaginal penetration"). Besides, there are far fewer social services (e.g., shelters) available to homeless men as compared to homeless women.