As Muslims, we are very fortunate to be the followers of such Deen which is complete and comprehensive. In our daily lives we ought to be cautious of how we interact and socialize with people, but there are certain rules
which must be followed strictly in order to repel any attacks of Shaitaan. When Allah forbids a Muslim from doing something it is often to stop other sins that may result from this sin.
Though sitting with ghair-mahrams (those whom one can marry) may seem like an action with no shame, no thought of sin, but in reality, it is such small actions that may lead to larger sins such as zina (fornication). In a Hadith, Prophet Muhammad Sallalaho Alaihi Wasalam said, "when two non-mahrams sit together, the third is shaitaan between them."
Sunan al-Tirmidhiy (Hadith 2165), verified authentic by Imaam al-Tirmidhiy.
And Allah knows best.
Ask Alimah Team
Note: The rulings giving herein are based on the religious rulings of the Islamic Law and do not have any implications on the Law of the Country. The rulings given hereunder are specifically based on the question posed and should be read in conjunction with the question. AskAlimah.com site bears no responsibility to any party who may or may not act on this answer. AskAlimah.com site being hereby exempted from loss or damage howsoever caused. This answers may not be used as evidence in any Court of Law without prior written consent of the web site.