After a largely harmonious day of campaigning this week, Maryland Gov. William Donald Schaefer recalled one discordant note from a high school rally.

"A senator said that we are building more prisons than schools," Schaefer said. "But we have to. The public demands it, and they don't want people let out."

Painful as it is to a governor running for reelection, the comparison between prison and school construction is a vivid reflection of a hardening attitude toward criminals. At the current growth rate, the population of prisons and jails will have increased nearly 50 percent during Schaefer's four-year term as governor, which ranks seventh nationally in per capita incarceration.

Despite a variety of new alternative programs, including early releases, home detention, electronic supervision and a military-style boot camp, Maryland prisons fill up as fast as they are built. Each month, the system has a net gain of 160 prisoners, leaving some to be housed in gymnasiums, prison libraries and classrooms.

Yet Schaefer, whose tough policies on drug-related crime helped keep the prison population exploding, gets high marks from political leaders and experts at least for avoiding a major prison uprising, and for naming strict disciplinarian Bishop L. Robinson as secretary of public safety and correctional services.

"He's done what geologists say couldn't be done: He's kept the lava inside an erupting volcano," said Del. Peter Franchot (D-Montgomery), a member of the state House appropriations subcommittee that oversees corrections.

Still, the campaign leading up to Tuesday's general election has been studded with prison-related embarrassments for the Schaefer administration and has produced a quiet debate over the course ahead.

Trying to ease the pressure on prisons, corrections officials this spring began liberally interpreting an early-release policy intended to give time off to inmates held two to a cell. By giving the credit to all inmates in crowded prisons, officials freed more than 1,000 prisoners this summer. The practice was stopped only when angry legislators demanded it.

In early September, authorities on the Eastern Shore arrested former inmate John F. Thanos and charged him in three slayings between Aug. 29 and Sept. 4. A subsequent check of prison records indicated that Thanos's April release from a rape conviction had come erroneously 18 months early.

And last week, the acting commissioner of corrections, Elmanus Herndon, retired after 28 years in the prison system. On his way out, Herndon complained bitterly about the lack of resources given to corrections officials, citing particularly the dearth of education and work programs that he considered necessary to prevent inmates from returning to prison.

As expected, the strongest criticism of Schaefer's corrections record has come from William S. Shepard, the Republican gubernatorial nominee. Shepard has said repeatedly that a "failure of leadership" in seeking even more prison construction led directly to premature inmate releases.

"If the program of letting criminals go free is because of inadequate construction, then it sends a grotesque signal to lawbreakers," Shepard said. "The early-release program Schaefer had . . . has been a disaster."

His criticism was seconded by Sen. Julian L. Lapides (D-Baltimore), a member of a Senate committee that serves as a watchdog on corrections spending.

"We score a C-minus in the area of corrections," Lapides said. "I think we've given enough money and wherewithall to keep them in for the full sentence."

Sen. Walter M. Baker (D-Cecil), chairman of the Judicial Proceedings Committee, said he failed in an attempt this year to tighten release restrictions because there was no more space to hold the inmates who would serve more of their sentences behind bars.

Robinson recently defended the early releases as a safety valve for a prison system in which the average sentence is 42 months and the average stay is 32 months. Without the programs, the state would need another 3,000 prison beds, as many as were added in the last 10 years.

Soon after the election, General Assembly leaders plan to form a task force to recommend new regulations on early prison releases. "The Thanos case cries out for a remedy," said Senate President Thomas V. Mike Miller Jr. (D-Prince George's).

Withold J. Walczak, a lawyer with the Legal Aid Bureau's Prisoner Assistance Project, said state leaders should forge a comprehensive solution to crowded prisons. "When you try to do things piecemeal, they don't seem to work," Walczak said.

Under the current master plan, the state expects to spend nearly $370 million more by 1995 to build prisons and partly replace a penitentiary built during the administration of President Thomas Jefferson.

But there is little discussion in the campaign of the question asked by Herndon as he announced his resignation: "Do we want to spend more money to build prisons or money to develop programs to keep inmates from coming back into prisons?"