A D.C. Superior Court judge ordered the release of two inmates yesterday whom he found were illegally detained at D.C. Jail for several months, and said it appeared that at the D.C. Department of Corrections "the left hand does not know what the right hand is doing."

Judge Henry F. Greene said he found it "remarkable" that two men could be "illegally detained" at a time "when the Department of Corrections . . . is under the kind of constraints it is . . . to keep the level of confinement under limits" set by a U.S. district judge.

Greene said he found the men's detainment even more "incredible" in light of his own recent experience with a prisoner he sentenced to a four-month prison term, but who was released into a halfway house after spending 10 days in jail.

Greene has ordered Corrections Director James Palmer to appear in court this month and explain why the inmate was transferred to a halfway house and allowed to work without Greene's permission.

"One gets the awfully strong impression that the left hand does not know what the right hand is doing," Greene told Metcalf King, the District's lawyer.

Greene ordered the release of Frank Williams, 37, and James Jenkins, 28, after their lawyer, Christopher Stone, described how the Board of Parole and Department of Corrections had violated procedures governing the incarceration of people arrested for parole violations on out-of-state convictions.

Stone said the two men, both under parole supervision in the District after serving out-of-state sentences, had not been arrested for committing any new crime in the District, but had been picked up after "technically" violating the conditions of their parole.

Stone said that in such cases the Parole Board must hold a preliminary hearing before an arrest is made. In addition, the inmate must be released if out-of-state corrections officials do not issue a warrant within 10 days of that hearing, he said.

Stone said the board not only failed to hold preliminary hearings before having either man arrested, but in Williams' case continued to hold him after Ohio said it did not want to "retake the man."

The two men apparently were discovered last week by Lorton officials after they had been shipped there from D.C. Jail in an effort by corrections officials to stay within a court-ordered population ceiling of 1,694 inmates. Jenkins was arrested Jan. 24 and Williams was arrested Oct. 18.

King told the judge that in recognition that there "have been some serious" violations of "the rights of these people," the Parole Board would release the two that day and that there was no need to issue a court order.

However, Greene said that given "what's already happened" in this case "it is difficult for me to place a whole lot of credence on a commitment being made by the Parole Board" and ordered the men's immediate release.

Later in the day, Greene issued another order demanding the men's release after Stone discovered they had been returned to D.C. Jail because corrections officials said the men had to be reinstated to parole from there.

Parole Board spokesman Frank Pazzella said yesterday that the board was investigating its procedures to insure that no similar situations occur.