“It was meant to be a good deed,” Mr. Schroeder said of posting the flier on Facebook.

He said other news media outlets had skewed the story: “They twisted this into an antipolice thing,” he said. “It wasn’t the police’s fault — they were just doing their job.”

Michael Jannone, chief of the Bound Brook Police Department, said the verbal attacks on his department from outraged people across the country had been “vicious.”

“We’ve been called everything from fascists to Nazis to Gestapo,” Chief Jannone said.

“Our officers were never going to give them a ticket for that,” he added. “I can’t even count the number of times I’ve paid $5 for a cup of lemonade from a lemonade stand — I didn’t tell those kids to get a permit either.”

Chief Jannone said the danger from the storm was real: About three minutes after the officers had left the shovelers, their patrol car slid in the snow into a telephone pole, causing $11,000 worth of damage.

He also worried about the situation’s effect on community policing: “There are already disheartening relations between communities and police around the country, and then you have something like this. It doesn’t help.”

State Assemblyman Michael Doherty, a Republican whose district includes Bound Brook and Bridgewater, said he thought the law “sends young people the wrong message” when it came to hard work and entrepreneurship.

“People have been shoveling snow for their neighbors for decades, if not a few hundred years,” he said in a telephone interview. “A law like this just shows how overbearing government can be.”