Two U.S. judges in Maryland in separate opinions yesterday ruled that the Maryland House of Correction and the Maryland Penitentiary are so overcrowded that conditions represent cruel and unusual punishment for the inmates and therefore are unconstitutional.

U.S. District Court Judges Alexander Harvey II and Stanley Blair ordered state prison officials to devise plans for the prompt reduction of the prison populations.

The judges found that the heart of the problem was the widespread practice at both institutions of housing two inmates in one cell. A practice they referred to as "double-celling."

In the century-old Maryland House of Correction, in Jessup, the practice of double-ceilling allowed more than 1,700 prisoners to be housed in a facility designed for 1,100 inmates, according to testimony in the case.

In the Maryland Penitentiary, which includes the Maryland Reception, Diagnostic and Classification Center, in Baltimore, there are 1,500 inmates - about 1,000 of them double-celled, according to the court opinion.

The judges found that the housing of two inmates in cells of 40- to 44-square feet in the prisons offended "contemporary standards of human decency."

Harvey ordered the absolute elimination of double-celling at the House of Correction, while Blair ruled that a "minimal" amount of double-celling under certain conditions might be acceptable at the penitentiary.

Harvey warned in his opinion that he would take action if lawyers for both sides in the controversy cannot devise an acceptable plan and timetable for the population reduction. He added that his order could include "as a last resort, the drastic and unwanted meausre of ordering the release of certain prisoners."

Neither judge set a limit on the number of inmates to be housed at the institutions in order to bring them in line with constitutional standards.

Mark Levine, commissioner of the Maryland Division of Corrections, said a total of 1,000 prisoners would have to be removed from the institutions in order to eliminate double-celling.

"We're still evaluating the opinions and we have to start discussing the implications," Levine said yesterday. "One option, of course, would be an appeal," Levine said, adding that no decision on an appeal has been made.

The rulings came yesterday in class action lawsuits brought separately by inmates at each institution. Testimony was heard in a combined hearing before both judges last March.

Judge Harvey also found unconstitutional the use of a special confinement area in the House of Correction, which he said "merely warehoused" inmates with psychological or psychiatric problems. He ordered that "actively psychotic" inmates be removed and transferred to state mental institutions.

In the penitentiary case, Judge Blair found that an isolation area, intended to hold mentally disturbed inmates on a short-term basis, was instead being used to confine such inmates for extended periods of time without adequate professional care. He ordered that the area be used only under emergency conditions and that inmates confined there be promptly reviewed by professional personnel.

However, Blair did not find unconstitutional several other types of facilities, such as medical treatment, recreation programs and food services, that inmates had contended did not meet constitutional mandates.

Both judges noted that Maryland officials had prepared plans to modernize prison facilities and had begun construction on new prisons in the state. But Harvey said that scheduled completion date for the construction is 1982, and that prisoners 'cannot wait for another four years' for improved conditions.

The judges' rulings are similar to a federal judge's 1975 opinion that found conditions in the century-old D.C. jail unconstitutional because of overcrowding.