The freedom to criticize judges and other public officials is necessary to a vibrant democracy. The problem comes when healthy criticism is replaced with more destructive intimidation and sanctions.
We don't have an Official Secrets Act in the United States as other countries do. Under the First Amendment freedom of the press freedom of speech and freedom of association are more important than protecting secrets.