“Unfortunately, at this time, I’ve been advised not to comment,” Mr. Rathbun said in a brief telephone interview on Thursday. “I have nothing to say.”

The incident came as assisted-living centers and nursing homes around the country have been ravaged by the coronavirus outbreak and as Jews have faced spasms of anti-Semitic violence, including attacks on synagogues in Poway, Calif., last April and in Pittsburgh in 2018.

Anti-Semitic attacks in the New York area have also been more frequent in recent months, with three people killed in a shooting at a kosher supermarket in Jersey City, N.J., and a knife attack at a rabbi’s home in Monsey, N.Y.

“In times of national crisis, hatred based on religion often blossoms into violence,” said Andrew E. Lelling, the United States attorney for Massachusetts. “We will find, investigate and aggressively prosecute anyone engaged in this kind of mayhem.”

Mr. Rathbun, who made an appearance in federal court via videoconference on Wednesday, has not yet entered a plea. A federal magistrate judge, Katherine A. Robertson, initially released him to home confinement in East Longmeadow, Mass., over the objections of prosecutors, who said the decision “appears to have been greatly influenced by the ongoing Covid-19 pandemic.”

On Friday, a federal judge, Mark G. Mastroianni, ordered that Mr. Rathbun be detained.

Mr. Rathbun’s federal public defender, Timothy Watkins, had argued that home confinement was appropriate. He pointed to the rapid spread of the coronavirus in jails and said that, given the notoriety generated by Mr. Rathbun’s arrest, and a stay-at-home order in Massachusetts, “it is frankly inconceivable that Rathbun would venture out into a lightly traveled world.”