A U.S. judge ordered Facebook Inc to give shareholders emails and other records concerning how the social media company handles data privacy, after data for an estimated 87 million users was accessed by the British political consulting firm Cambridge Analytica.