A federal judge dismissed a Facebook shareholder derivative suit claiming the company harmed investors by not following through with its stated commitment to diversity and inclusion.