The Chief judge of Maryland's highest court today sharply attacked the suggestion of the state's new corrections commissioner that Maryland may need to jail fewer criminals rather than build more jails.

In a speech before the General Assembly, Judge Robert C. Murphy aligned himself with the critics of Gordon C. Kamka, saying that the idea of finding alternatives to a new prison may be unnecessary is "an Alice-in-Wonderland, pie-in-the-sky solution."

For the past three years, two governors and the legislature have agreed that a new $26 million prison must be built, particularly in light of severe overcrowding in the state's existing facilities and an existing U.S. court order requiring that this situation be corrected.

The only real question during this time has been where such a facility should be located.

Kamka, who has refused to rule out construction but said he "is not convinced" it is needed, favors looking at a wide range of options including expanded parole and probation with more stringent supervision and the use of small community-based rehabilitation centers to deal with overcrowding.

Murphy, criticizing the plan, said that to protect the public and to deter crime jail sentences must be given to the increasing numbers of offenders coming before state judges.

As long as this is true, more prison facilities will be needed, the judge added.

Kamka's philosophy was blasted earlier this week in Annapolis by senators considering his nomination as Gov. Harry Hughes' public safety director noted that philosophy "should be popular with the prison population." but wondered how it would sit "with law-abiding citizens."

While some legislators criticized Kamka at his confirmation hearings, others praised him for keeping an open mind about the situation.

Komka's suggestion was made at a time when there are about 2,000 more inmates in Maryland's system than it was designed to hold.

The state is also under a U.S. court order to end the double occupancy of cells for 1,100 inmates by June 1980. Three of Maryland's largest prisons are 100 or more years old, characterized by many corrections experts as "antiquated Bastilles."

Kamka calls the overcrowding "a legitimate crisis," but wants a special committee of experts, named by Hughes to recommend solutions, to complete its work next month before he makes any decisions.

The group last week began to sift through a confusing array of statistics, which Kamka noted yesterday are open to various interpretations.

The committee was told that Maryland in 1977 incarcerated more people per capita than all but four other states in the nation, while ranking far down the line, 15th in crime rate.

According to the Maryland Alliance for Prison Alternatives, about 65 percent of those committed to state prisons in 1977 were convicted of nonviolent crimes. The group concluded that there is "no necessily for the excessively high incarceration rate."

Richard C. Wertz, executive director of the Governor's Commission on Law Enforcement and the Administration of Justice and author of the state's 1977 prison construction plan, argued that these statistics can be misleading.

The state prison system must accept defendants with sentences as short as 90 days, and these short-term prisoners drive up the incarceration rate, he said. In comparison, many states with low rates place such prisoners in their local jails.

Kamka said in a recent interview he believes the incarceration is excessive and he is focusing on the prisoners with short sentences in his effort to find solutions.

"If 40 percent of the persons entering the system are sentenced for two years or less," said Kamka, citing yet another statistic, "I'm suggesting those should be examined for placement in community programs."

Judge Murphy, chief of the state's appeals court, yesterday argued with that figure, saying only 11 percent of the inmates were sentenced for two years or less.

Murphy also said that even if some of Kamka's aims are realized "the need for additional secure penal facilities to incarcerate hard-core, recidivistic and other serious criminal offenders to protect society would seem apparent. and this is whether the offender is physically dangerous or not, or whether the crime was committed against the person or against property."

Kamka refused to be pulled yesterday into open disagreement with Murphy on what he called their "differing philosophies."

But he stuck to his won philosophy, saying the state "has finite resources," that "prison beds are a valuable commodity we want to use wisely," and that policy decisions will have to be made based on those facts.

The Senate committee considering Kamka's nomination has delayed its vote on the appointment until next week, but it did not appear today that his confirmation was in any serious danger.