Neal Catapano believed he was helping a man with his rehabilitation when he first hired convicted sex offender Joseph Wolm in March 2013.

Mr. Catapano, who runs an online hobby business from an office at his family farm on Main Road in Southold, said the idea came from the pastor of a local church who led a jobs program for parolees.

The employment ended earlier this year when Mr. Catapano learned that Mr. Wolm had left behind a USB drive containing child pornography. That discovery then led to an investigation into more than $115,000 in thefts from the hobby business, alleged to have been made by Mr. Wolm and another convicted sex offender hired through the jobs program.

“This is a classic case of the cliché no good deed goes unpunished,” said Joseph Sferrazza, Mr. Catapano’s attorney.

Mr. Wolm, 42, of Mastic Beach was arraigned Tuesday on 27 felonies, including 25 counts of possessing a sexual performance by a child.

He is also facing charges of second- and third-degree grand larceny along with Ernesto Martinez, 56, who lives in a Mastic Beach home owned by Mr. Wolm and began working for thewarstore.com in April 2014, four months after he was released from prison following a conviction for sexual conduct involving an 11-year-old girl.

Both men pleaded not guilty to the new charges at their arraignments this week in Suffolk County Criminal Court in Riverside.

Mr. Wolm is being held on $300,000 cash bail or $600,000 bond on the two indictments, but also faces a parole hold. Mr. Martinez was being held in lieu of $150,000 cash bail or $300,000 bond.

Attorney Donald Mates of Hauppauge, who said he was privately retained by friends of Mr. Wolm, denied his client’s involvement in the alleged crimes.

“He’s being set up,” Mr. Mates said. “I don’t know by who, but he’s being set up … In the end he will be exonerated.”

In an interview Monday, the afternoon Mr. Martinez was arraigned on a grand jury indictment, Mr. Catapano said he knew both of the men he employed were registered sex offenders, but was unaware of the exact nature of the crimes they’d been convicted of.

Mr. Wolm had previously served 7 1/2 years in prison for sexual conduct involving a 9-year-old boy, according to a sex offender registry maintained by Parents for Megan’s Law, a nonprofit aiming to prevent sexual abuse and provide services for victims of sex crimes.

Federal court records show Mr. Wolm sued the executive director of that nonprofit in June 2014, claiming the database was a violation of his constitutional rights. The case was dismissed a year later.

Both Mr. Wolm and Mr. Martinez are “Level 2 sex offenders,” which means under New York State guidelines they are considered violent offenders with a moderate risk of recidivism.

Mr. Wolm had been out of prison for only five months when he went to work for Mr. Catapano, who hired him after being approached by the pastor of East End Full Gospel Church in Riverhead. Mr. Sferrazza said Mr. Catapano and his wife, Dorothy, knew both Mr. Wolm and Mr. Martinez through the church, where the men were known to take an active role. A video posted on the church’s Youtube channel shows Mr. Wolm delivering a passionate 42-minute sermon on allowing God to lead a person to “freedom from slavery.” (Editor’s Note: The video was removed shortly after this story was posted Tuesday.)

The pastor of the non-denominational East Main Street church did not respond to a telephone message seeking comment Tuesday morning.

Mr. Catapano and Mr. Sferrazza said both Mr. Wolm and Mr. Martinez were prohibited from direct contact with the public while in the Catapanos’ employ.

“Their jobs were to pack boxes, ship items and create eBay listings for thewarstore.com,” Mr. Sferrazza said. “To the best of my clients’ knowledge, they complied with the conditions of their respective paroles, which included random inspections at home and at work.”

Mr. Sferrazza said the men did not have any involvement with the Catapanos’ farm business or the retail hobby shop the couple owns in Middle Island. They also were not permitted to leave premises during the work day, Mr. Sferrazza said.

“They worked in the office,” Mr. Catapano said. “[Mr. Wolm] was six feet away from me all day.”

Federal Elections Commission filings show Mr. Wolm identified himself as the internet sales manager at thewarstore.com in a series of donations to Sen. Ted Cruz’s presidential campaign.

Mr. Catapano said it wasn’t until his 27-year-old son discovered the pornography on the USB drive that he realized something was amiss. Mr. Sferrazza said Mr. Wolm was also using “TOR software to try and hide his activity.” According to prosecutors and the indictment, the drive contained 25 photographs depicting children under 16 years old performing sex acts.

The discovery of child pornography was reported in April to Southold Town Police and Mr. Wolm was arrested on a parole violation. He has been held at the county jail in Riverside ever since, records show.

Soon after, the Catapanos noticed that Mr. Wolm and Mr. Martinez had been stealing items from the hobby business for about two years, Mr. Catapano and Mr. Sferrazza said. Mr. Martinez’s employment ended in May and he was indicted along with Mr. Wolm on Nov. 27.

Assistant Suffolk County district attorney Maria Troulakis said the men would steal inventory from the business and sell it online. Mr. Sferrazza said the items were sold on Amazon.com accounts opened by the two men. In order to keep the crime hidden, they used a Massachusetts address for their business, Ms. Troulakis said at Monday’s arraignment

Mr. Sferrazza said that while prosecutors alleged the men stole more than $115,000 in items from his client, he estimated the actual thefts to be upwards of $225,000.

“This was a well thought-out, intentional and deliberate crime,” Ms. Troulakis said.

Assistant Suffolk County district attorney Michelle Chiuchiolo, who handled Tuesday’s arraignment, said Mr. Wolm made oral admissions to the farm owners and investigators about the child porn and the larceny.

Mr. Catapano, who said he did not receive any tax breaks for hiring parolees, expressed devastation at learning of the crimes against him and others the men are accused of.

“It really looked like they were trying to get better,” he said.

He added that the two men had become deacons at Riverhead church and were teaching Sunday school to adults.

In a 2013 interview with Newsday for a story about sex offender clusters in certain communities, Mr. Wolm, who records show was living on Rachels Road in Mattituck at the time, spoke of the challenges of being a registered sex offender and having your past convictions so widely publicized. He said one time he was threatened by a man with a knife while waiting for a train. “He said, ‘No one would care if I killed you,’ ” Mr. Wolm told the paper.

Now Mr. Wolm faces up to 19 years in prison if convicted of his latest alleged crimes.

Mr. Martinez faces up to 15 years if convicted of the thefts. Both men are due back in court in January.

Mr. Catapano and his attorney expressed gratitude for the investigative work that led to the arrests of both men.

“The police, detectives and district attorney are to be commended for their work and the investigation,” Mr. Sferrazza said. “The entire matter has been very stressful for my clients.”