You can set the privacy to prevent outside access
If your Facebook is accessible only to friends, or only to friends of friends, then DHS staffers won't be able to see anything. They'd have to ask for your passwords for there to be a point to asking at all.
One would presume those entering the US with plans to commit terrorism would either have no social media accounts, lie and claim they have none if they do, or have dummy accounts that look presentable to US authorities. Any terrorists they caught with this are the ones who were not really serious or who would have been caught in other ways. Then there are all the false positives, from people who may show some sympathy towards terrorists or at least hostility towards the US, but have no intent on committing any sort of terrorist attacks. Last time I checked, thinking good thoughts about the US and its foreign policy wasn't required for entry - though undoubtedly there are some who would change that if they could.