Mr Justice Weatherup identified issues over funding and programmes, describing the approach to helping those in and out of prison as "shortsighted."
He said: "I know this is a question of priorities, but perhaps laying kerbstones around country roads could wait while we try to address these more pressing problems some of our fellow citizens have to put up with."
His assessment came as he refused bail to a heroin addict amid fears of a relapse if released.
Robert Gannon, of Dunvale Close, Derry, faces charges of robbery, fraud by false representation and converting criminal property.
The alleged offences are connected to the theft of a handbag and use of a card to get money for drugs.
Gannon, 26, was said to have returned to his native city after becoming addicted to heroin during a period living in Dublin.
According to the prosecution his compliance with treatment services in prison has not been confirmed.
After receiving the update, Mr Justice Weatherup said: "What is striking to me in respect of this case is how unsatisfactory our health and care system is for people who are in this position."
He set out how addicts can get caught up in cycle of arrest, conviction and imprisonment as they resort to crime.
"Then one finds that while there's an obvious need to address the addiction, the services available don't seem able to do that," the judge pointed out.
"In the prison they don't have the funds and it's extraordinary (when) the incidents of addiction is so high amongst prisoners that there has to be a waiting list."
Mr Justice Weatherup acknowledged how Gannon would also face a waiting list to get onto a community addiction programme if released.
"Is that helping him? Certainly not," he said."It's very shortsighted that these things aren't addressed more urgently."
Refusing to release the accused, he added: "I can't grant him bail because I feel because of his addiction and lack of treatment that I think is available he is liable to revert to his addiction.
"The safest place for present purposes is that he remains in the limited treatment he is receiving in the prison service."