The homeless man accused of setting a fire Wednesday morning that eventually claimed two Canal Street buildings grinned, grimaced and muttered before his name was called in court Thursday.

Almost as soon as a public defender entered a not guilty plea on behalf of Darren Denley, a judge announced that she was ordering him to be held until he could receive a psychiatric examination.

“I think it’s pretty evident that there is a competency issue here that needs to be addressed,” Municipal Court Judge Desiree Charbonnet said.

Investigators say Denley set the fire to warm himself. The minor offenses lodged against him might usually bring a small fine or at most six months in jail. But the court hearing quickly made clear that Denley, 25, has bigger issues than municipal counts of burning trash improperly and crossing a police line.

One homeless advocate said the situation underlined the dire need for housing and mental health services in post-Katrina New Orleans.

City officials, meanwhile, said in a statement that there seemed to be no immediate danger both at the building at 1016-22 Canal St., where they said Denley started the fire, and the adjacent building at 1012 Canal St., which also was scorched. Both buildings’ facades are stable and in no danger of collapse, said Hayne Rainey, a spokesman for the Mayor’s Office, and thus the city will not reroute any nearby Carnival parades this weekend. But a fence will be erected around the buildings “out of an abundance of caution.”

Despite slightly different birthdates given in court records, Denley appears to be the same man as a Houston resident with a long rap sheet there, including several arrests for trespassing and a Jan. 8 plea agreement for indecent exposure.

How Denley made his way to New Orleans, or his connection to the city, was not immediately clear. Court files listed addresses both in the 4400 block of Cessna Court in New Orleans East and at the Ozanam Inn, a homeless shelter in the Central Business District operated by the Society of St. Vincent de Paul. A manager there said he had never seen Denley.

WWL-TV captured video on Wednesday of a disheveled Denley yelling at one of the channel’s cameramen as he was led away from the scene of the fire by an investigator. Denley could be heard stating he was asleep when the fire started, and then adding, “I want my money. I want respect.”

Inside the courtroom Thursday, the spectacle continued. Denley objected to a public defender entering a plea on his behalf. He loudly and repeatedly asked to take a lie detector test. And he once again proclaimed his innocence.

“I did not do it,” Denley shouted at reporters. “I was asleep when that fire started.”

Charbonnet admonished Denley to stay quiet. As an Orleans Parish sheriff’s deputy led him away from the courtroom, he uttered a stream of profanities that appeared directed at the judge. After he was out the door, Charbonnet addressed the courtroom.

“Generally, a gentleman would be held in contempt of court for using that kind of language, but because his competency is at issue, the court will refrain from doing so,” she said.

A brief arrest report in Denley’s case file, written by New Orleans Fire Department Investigator Wayne Regis, says Denley told investigators he “intentionally ignited paper in front of the initially burned building” to stay warm.

Lindsey Hortenstine, a spokeswoman for the Orleans Public Defenders, declined to comment on Denley’s case. In general, she said, “increasingly (the city’s jail) is becoming the dumping ground for mental health issues.”

“We as a community should focus on the public health crisis of underfunded mental health services, and we would be better served investing in adequate resources at the front end rather than the far greater costs, both economic and human, waiting for someone to enter the criminal justice system because of those untreated mental health issues,” Hortenstine said.

Temperatures on the morning of the fire had fallen to about 41 degrees. Martha Kegel, executive director of the homeless service organization UNITY of Greater New Orleans, pointed to the Canal Street fire and a December 2010 blaze that claimed the lives of eight transients in the 9th Ward as reminders of the need for more affordable housing and mental health services.

“The fire this week was a terrible fire, and it could have been a true tragedy if someone had been killed,” Kegel said. “He seems like he would be a high priority for the whole community to get him the housing and the medical care and the services that he needs, so that he doesn’t set another fire simply because he’s desperate to stay warm.”