Free in terms of monetary costs but not free in terms of absolute costs for example time and emotional depletion.
For some people they see social connections as more risks that they can possibly lose something and be hurt if things don't work out or they are rejected.
And in general social connections require some type of mutual benefit so it is necessary to "give" as you "get".
Then another layer are that social connections in general need a reason. Is it a club, hobby, job, etc. which takes time and energy.
These "costs" are not universal and vary from person to person.
All these things can be overcome, but it is also important to look at the other side because the reason that people prefer just buying a pill to fix their problems is that the above mentioned costs for them are greater than the price of alternatives like medication, social media, gaming, etc.