In these lines, the author summarizes the virtue of Uzla (isolation/solitude) which means abstaining from contact with people to avoid the possibility of committing sin. Here Uzla gives us the positive meaning of life. It advises not to do things which are not important to you. As the prophet r told us:
مِنْ حُسْنِ إِسْلامِ المرْءِ تَرْكُهُ مَا لا يَعْنِيهِ[1]
It is good for a Muslim to keep away from un-important things.
By meeting with people one forgets about himself and gets occupied with chitchat with others which leads to backbiting and gossip. Friends and relatives would be one of the major causes of one’s failure if they kept giving him wrong signals, dispiriting from the personal development. Bad people always beautify the false and disfigure the good, Ibn Ataillah t said in his Hikam
لَا تَصْحَبْ مَنْ لا يَنْهَضُكَ حَالُهُ وَلَا يَدُلُّكَ عَلَى اللهِ مَقَالُهُ[2]
Don’t accompany those people whose acts do not awaken you and whose words do not lead you to Allah.”
The isolation is preferred when
1. the circumstances in which he lives are not suitable to perform religious duties in perfect condition.
2. he fears falling into the trap of committing a sin because of interaction with people and
3. he fears of taking wealth from Haram (prohibited) or Shub-ha (semi prohibited).
In the last line, the author reminds us that later scholars had preferred isolation to socializing because they found all those gathering guilty.
However, isolation is not allowed to those who are
1. able to convey the message of Islam, instruct good and forbid evil,
2. able to be patient during the disturbances of the people and
3. sure of not falling into sin at the gatherings.
In short, the core point here is to prepare oneself for doing good things, worshipping Allah, and not doing bad things. If he finds that interacting with people is a barrier for him (it is not a barrier when used in a wise manner), it is good for him to do Uzla (isolated life). It is a way to abstain from disobeying Allah.