In general, states place limits on admitting that kind of evidence based on the fear that jurors might convict someone because they have a bad character rather than based on evidence that they committed the crime in the indictment. In New York, judges are expected to weigh the “probative value” of the evidence versus the “prejudicial effect” on a jury when considering whether to admit such evidence.

Judge Farber wrote in his order that while admitting all 19 witnesses that prosecutors requested would result in “undue prejudice,” he said that the “probative value of admitting a limited selection of incidents outweighs any such prejudice.”

Mr. Gooding’s legal team argued specifically against the admission of witnesses whose accusations dated back more than a decade ago or could not be narrowed to a specific date or location, saying that those limitations made it difficult for the actor to fully defend himself.

The allegations that Judge Farber chose are more recent and are alleged to have occurred in specific locations that prosecutors provided to the court. In one of the alleged encounters that was admitted as evidence, a woman told prosecutors that she was at a work event at a bar in the Chatwal hotel in Midtown Manhattan around the date of Nov. 7, 2013, when Mr. Gooding grabbed her backside and licked her neck, according to court documents.

In the other encounter, a woman said that she was introduced to Mr. Gooding at a party at the Shore Bar in Santa Monica, Calif., around the date of Aug. 16, 2018. As they were talking, the woman said, Mr. Gooding grabbed her buttocks and her breast and forcibly kissed her, inserting his tongue into her mouth before she pushed Mr. Gooding away, according to court documents.

Groping allegations against Mr. Gooding first became public in June when a woman told the police that Mr. Gooding squeezed her breast at Magic Hour Rooftop Bar at the Moxy NYC Times Square hotel on Seventh Avenue in Manhattan. Since then, 21 women have come forward, resulting in two of the sets of charges — for accusations that Mr. Gooding pinched a female server’s buttocks at Tao Downtown nightclub in Chelsea and forcibly kissed another female server at Lavo, an Italian restaurant and nightclub on East 58th Street, in 2018.