"And the two angels came to Sodom" (Genesis 19:1). From here you learn that they did not go to Sodom until He had finished speaking with Abraham. And why in the evening? So that the men of Sodom should not see them. "And Lot was sitting in the gate of Sodom" — so that if a person should pass by from there, he might receive him.
Why the Angels Came to Sodom at Evening and Lot Sat in the Gate
Midrash Aggadah, Genesis 19:1
ויבאו שני המלאכים סדומה. מכאן אתה למד שלא הלכו לסדום עד שכלה לדבר עם אברהם. ולמה בערב, כדי שלא יראו אותם אנשי סדום: ולוט יושב בשער סדום. שאם יעבור אדם משם שיקבלנו: