A Palestinian student from Lebanon who was set to begin his freshman year at Harvard was denied entry to the United States after immigration officials objected to his friends’ social media posts, he said this week, prompting furor among free-speech advocates.