The Torah says that Hashem spoke to Abraham after Lot had separated from him. Lot was not a spiritual person, and as long as Abraham was in his company, He did not receive any Divine communication.
There is no question that Abraham retained his piety and integrity even in the companionship of Lot. Hashem related to Abraham in this manner to teach us that regardless how strong a person is in his convictions, the association with immoral people is hazardous.
In recovery we are told to avoid “people, places and things” that can jeopardize our recovery. The Talmud says, “Do not trust in yourself (that you are beyond corruptibility) until the day of your death” (Ethics of the Fathers 2:4). We must use utmost caution to safeguard our recovery.