During oral arguments, justices grappled with questions of how to protect children while preserving free speech and privacy.