The judge excoriated Mark Zuckerberg and members of his team for wearing the devices during a high-stakes trial over social-media addiction.