The right to a public trial is not absolute
One of the basic rights of criminal defendants is the right to a public trial. When our forefathers established the constitution, one of the abuses that they sought to curb were secret trials that could be used by unscrupulous prosecutors to suppress dissent, clearly not a good concept in a democratic society. They rightfully felt that public trials would serve as a shield against oppressive government. Indeed, one of the common features of most dictatorships is the use of secret trials where neither the press nor the public is allowed to view the proceedings.
The right is not absolute. Where a public trial could expose law enforcement agents to a risk of exposure in an ongoing investigation or when a national security interest could be compromised by a public trial, the courts have consistently permitted limits being placed on the right to a public trial.
This ruled the New York State Court of Appeals on February 15, 2011 in the matter of People v. Campbell, cited at 16 New York [Court of Appeals Reports] 756. The court held that the exclusion of two relatives of the defendant from the courtroom during the testimony of an undercover officer, on the ground that the relatives lived near the area where the undercover was conducting ongoing investigations, was not improper.