Rabbi Abbahu quotes Rabbi Hanina as teaching that a person should avoid sinning in a public forum, which will lead to hillul HaShem – desecration of God’s name – and should prefer to sin in private. Following this teaching, the Gemara quotes Rabbi Ilai haZaken who rules that if a person sees that he cannot control his evil inclination he should go to a place where no one knows him, he should dress in black, i.e. in simple clothing, and do what his heart desires, rather than publicly desecrate the name of God.
The Gemara raises an objection to this ruling by quoting a baraita that teaches that with someone who shows disrespect to God, it would have been better had he never been born – a teaching that is interpreted by Rav Yosef as referring to someone who sins in private, since by sinning privately he shows that he is more concerned about how he is perceived by his peers than by how God views him. The Gemara answers that we must distinguish between a situation where the person could control his “evil inclination” and where he simply cannot.
Regarding the ruling itself, which appears to permit sinning in private, Tosafot quotes Rabbenu Hananel as explaining that the travel and change in dress are supposed to bring about a change in heart of the individual, and the hope is that by putting limitations on him he will refrain from sinning. Others point out that that is not the simple flow of the Gemara, and that Rabbi Abbahu certainly did not intend to permit sinning, rather he suggests that the lesser of the two evils would be to commit the sin privately rather than publicly.
The Me’iri writes that even Rabbi Abbahu would not recommend that the person travel and sin, rather we must understand that this is discussing an act that is inappropriate, rather than one that is truly forbidden.