A judge ruled yesterday that the way Maryland's public schools are financed is unconstitutional and called on the state legislature to come up with a new system to equalize spending for schools in rich and poor districts. The decision could drastically affect schools in affluent Montgomery County. t

The ruling by Judge David Ross of Baltimore's Supreme Bench came in a suit filed two years ago by several of the state's poorest school districts. It is widely expected to be appealed by both state and Montgomery County officials to Maryland's highest court, the Court of Appeals.

Nevertheless, the judge's 40-page opinion is considered likely to have a powerful impact on the Maryland Assembly and, if upheld, will require a revolution in the state's school financing.

The General Assembly's House Speaker, Benjamin L. Cardin (D-Baltimore), said last night that the judge's ruling would take years to implement if upheld, and that the legislature was unlkely to take the steps it orders until all appeals are exhausted. "It's a radical departure from the present law," Cardin said. "It really does violence to the concept of public education in Maryland."

Judge Ross agreed with arguments of the poor school districts -- including Baltimore -- that the present school funding scheme, based in large part on local property taxes, violates the state consitituion's articles concerning education and equal protection under the law, although he ruled the system did not violate the U.S. Constitution. The U.S. Supreme Court ruled in 1973 that the federal Constitution did not require equal financing of schools.

While rich counties like Mongomery devote millions in local tax money to schools in addition to state school aid, Judge Ross noted, poor counties have no such resources.

"The evidence shows that the present financing scheme significantly underfunds" schools in the poorer counties, "whose requirements are at least as great as any in the state, while it permits virtually unlimited spending" in other localities, the opinion says. It concludes "the present system is unconstitutional . . . and therefore it must be overhauled. . . . There is no reason to believe the General Assembly will not perform its duty."

The judge said the legisture would have to create a new system under which the same amount would be spent on each pupil across the state, except in cases where differences in cost can be conclusively proved.

That means that the state would have to devise a plan under which Montgomery County, which spent $2,328 per pupil in the 1977-78 school year, allocated the same funds per pupil as rural Caroline County on the Eastern Shore, which spent $1,498 on each pupil in the same year.

State officials said yesterday that the cost of bringing school spending around the state to the level of Montgomery County would approach $700 million -- more than 10 percent of Maryland's current state budget. The only other alternatives, officials said, would be to have the state take over all funding of public schools, elimination taxes and appropriations by local school boards, or to place limits on the amount wealthy counties can spend.

Even if these drastic changes are not required, the impact of the decision in Montgomery would likely be enormous, county officials said. If, under a more moderate plan, the $700 million in annual state education aid were to be equalized among local school districts according to wealth, Montgomery County would lose $36 million, or 51 percent of its state school aid, officials said.

Currently, about half of the state's aid to local schools is distributed according to the wealth of the jurisdictions, with the poorer counties getting proportionately more. The remaining $350 million is included in programs that reimburse local schools for the cost of such items as bus transportation and special education, and is paid out according to formulas based on factors that do not account for local wealth, such as number of pupils.

The current distribution system, devised by the legislature several years ago in part as a means of avoiding a court case, was the one that was challenged successfully in the suit. The poor localities argued that the current system does not go far enough in recognizing differences in wealth -- and thus potential tax collections and spending across the state.

Montgomery County officials, who have spent $1 million helping the state attorney general's office defend the suit, expressed dismay yesteday but argued, as county Del. Lucille Maurer put it, that "this is just round one." a

While agreeing with that assessment, the state's chief lawyer in the case, Deputy General George Nilson, nevertheless noted: "here sits a very strong opinion. . . . It could have enormous fiscal impact."

Gov. Harry Hughes, who is expected to order an appeal by the state, left on a trip to Europe yesterday before the decision was announced. But Nilson said state lawyers had regarded the decision by Judge Ross -- who is the equivalent of a circuit court judge -- as "a stopping point on the way to the Court of Appeals." Nilson said the court could issue a final ruling as soon as early next year.