A 17-year-old Palestinian incoming Harvard University freshman who lives in Tyre, Lebanon, said he was refused entry to the United States on Friday—after more than five hours of questioning by authorities—over his friends’ social-media posts.