“People’s lives were in danger before my eyes and I was not going to tolerate it,” he told reporters. “I regret if the way I said it in any way gave people a feeling of being treated the wrong way, that was not my intention. It was said with love, but it was tough love, it was anger and frustration.”

Jonathan Greenblatt, the head of the Anti-Defamation League, said the mayor’s remarks were unfair to the more than one million Jewish people who live in New York City. “The few who don’t social distance should be called out — but generalizing against the whole population is outrageous especially when so many are scapegoating Jews,” he wrote on Twitter. “This erodes the very unity our city needs now more than ever.”

Jacob Mertz, a spokesman for the rabbi’s synagogue, Kahal Tolath Yakov, said in a statement that it had tried to organize the funeral to stay within social distancing guidelines but “unfortunately, this didn’t pan out, and NYPD had to disperse the crowds.”

“We came up with a plan to have many streets closed, so that mourners can participate and walk the coffin while following the social distancing rules and wearing masks,” Mr. Mertz said in a statement. “New Yorkers walk the streets daily, thus, a funeral — we thought — shouldn’t be different, as long the rules are followed.”

Mr. de Blasio has longstanding ties to the ultra-Orthodox Jewish community, which supported him as he rose through the political ranks from the City Council, then as public advocate and as mayor.

When Mr. de Blasio needed donations to his flailing presidential campaign to qualify for the democratic debates, he turned to Orthodox donors.

But the mayor has run into frequent political headaches related to public health issues in the ultra-Orthodox community, including the measles outbreak and his policy on a circumcision ritual, metzitzah b’peh, that led to multiple children becoming infected with herpes.