A Westhampton Beach teacher charged with recording middle school-aged girls in a gym locker room pleaded not guilty to the charges in a Riverhead courtroom on Monday morning.

Thomas Sheppard, 27, of Speonk pleaded not guilty to all counts at the Suffolk County Criminal Court in Riverhead, during an arraignment on one felony count of second-degree unlawful surveillance and seven misdemeanor counts of endangering the welfare of a child.

During the arraignment, Judge Barbara Kahn issued seven orders of protection, prohibiting Mr. Sheppard from contacting his alleged victims and witnesses. During the roughly 20 minute proceedings, James Chalifoux, the deputy chief for the major crimes bureau in the Suffolk County District Attorney’s office, told Judge Kahn that it was clear to the prosecution the incident was not a mistake, as some have alleged, and that Mr. Sheppard deliberately filmed 13- and 14-year-old girls by placing his cell phone in the girls locker room when they were scheduled to change clothes.

Mr. Chalifoux added that Mr. Sheppard had attempted to erase the video, but it was recovered by authorities.

"The video makes it very clear that this is not a mistake," he said. "The video clearly shows the defendant setting up the phone to record these young girls undress."

Due to the nature of the crime, Mr. Chalifoux requested that Mr. Sheppard’s bail be doubled to $50,000 cash bail, but the request was denied by the judge.

Mr. Sheppard did not speak during the arraignment and his attorney, Peter Brill of the Brill Legal Group, only briefly stated that his client was not a flight risk and has never been in trouble with the law.

He was arrested by New York State Police on March 20. Police said their investigation revealed that Mr. Sheppard, a four-year employee of the district, placed a video recording device in the girls locker room at the middle school.

Investigators have not said when the incident took place, although district officials contacted Westhampton Beach Village Police on February 26 to request an investigation. Village Police later requested that State Police take charge of the investigation.