ANNAPOLIS, SEPT. 8 -- Maryland's highest court ruled today that the state's plan to build two stadiums in downtown Baltimore cannot be placed before voters on a statewide referendum, a decision that Gov. William Donald Schaefer said clears the way for a new home for the Orioles baseball team for the 1990 season.

The decision kept alive Schaefer's dreams of luring a National Football League expansion team to Baltimore, and it dashed the hopes of those who had collected nearly 45,000 signatures in the effort to place the project, which they called an inappropriate function of state government, on the November 1988 ballot.

"We've got a mandate to build the best stadium in the country, and we will," an elated Schaefer told reporters. He said that the project will now move ahead quickly and that construction of the $62 million, 45,000-seat baseball stadium will begin as soon as Orioles owner Edward Bennett Williams signs a long-term lease to keep his team in Baltimore. Williams has said he would not consider signing a long-term lease unless a new stadium is built.

Opponents of the project, which was championed by Schaefer and approved during the General Assembly session in the spring, said the stadium complex would have been rejected by voters, as public opinion polls had indicated.

"We may have lost in the Court of Appeals, but we won in the court of public opinion," said state Sen. Howard Denis (R-Montgomery), one of the leaders of the petition drive. He predicted that the state's financing proposal for the complex will fail and that taxpayers will foot the bill for "the most massive bailout in the history of Maryland."

By a 6-to-1 vote, the Court of Appeals reversed a lower court's opinion and said that the stadium plan is covered by a constitutional prohibition on referendums on laws "making any appropriation for maintaining the state government."

The court held that the stadium plan passed by the legislature is "a finely tuned law containing an intricate financing mechanism" that qualifies as an appropriation.

But the court, in essence, passed on the question of whether building stadiums is a primary function of government, saying that financial support of stadiums is a practice "of long standing."

The state constitution "requires only that the appropriation be one for maintaining the state government, and we will not second-guess the legislative determination," said the opinion written by Chief Judge Robert C. Murphy. "Whether the stadium project is of more or less fundamental importance than other governmental expenditures is not for the courts to decide."

Judge William H. Adkins II dissented. He said that the money has to be spent for a primary function of government in order to be exempt from a referendum.

"But government will not come to a halt if the stadiums are not built, and no primary or essential function of government will be one whit affected if the people are allowed to vote on the stadiums package in 1988," Adkins wrote.

The plan authorized by the legislature allows the state to sell up to $230 million in bonds to pay for the stadium complex in Camden Yards, near Baltimore's Inner Harbor.

Acquisition of the site, demolition of buildings, relocation of businesses in the 85-acre area, and construction of the baseball stadium and a $67 million, 65,000-seat football stadium are expected to cost slightly more than $200 million. Each would have a natural grass playing field, and each would have luxury skyboxes -- 48 in the baseball stadium and 104 for football.

The bonds are to be repaid with operating revenue from the Maryland Stadium Authority, an annual $1 million grant from the City of Baltimore and an additional $16.4 million a year from up to four special "sports" lotteries held by the state.

Stadium opponents have argued that the sports lotteries would drain profits the state now makes from other lottery games. Tickets for the first sports lottery game went on sale July 13, and the game is expected to continue for several weeks.

William S. Ratchford II, director of the state's Department of Fiscal Services, said it is too early to tell what impact the sports lotteries will have on other lottery revenue. But an internal memorandum that Ratchford's department prepared recently for legislative leaders said that this year, "for the first time, it appears net sales {for one of the other lottery games} will be less than budgetary projections -- by $3 million."

Until now, Orioles owner Williams has signed only yearly leases to keep his team at Memorial Stadium.

Stadium Authority Chairman Herbert J. Belgrad said that there were two days of negotiations with the Orioles last month on a new contract and that more meetings are scheduled for this month.

He said he expected Williams to sign a lease for at least 15 years by the end of the year.

Requests for bids for construction, de- molition and appraisals of the land that must be purchased will commence soon, Belgrad said, although work cannot begin until the Orioles lease is signed.

Belgrad said the team could begin playing in a new stadium in 1990, although not necessarily in time for opening day. A task force is to decide the fate of Memorial Stadium.

Belgrad said that the authority will hire a professional consultant to make a "complete and comprehensive" study of various private financing plans submitted to the authority.

The legislature said that private financing must be explored before the state can proceed with bond sales for the stadiums.

The examination of the private offers was to have been made by a committee headed by Charles Benton, the longtime director of finance for Schaefer when he was mayor of Baltimore.

But Belgrad said he decided to hire an outside consultant so that there would be the "greatest public confidence" in the report.

Construction of the football stadium cannot begin unless the NFL awards the city a franchise. NFL Commissioner Pete Rozelle said today that an expansion committee will be appointed by March and that two new teams will be selected by 1989.

Rozelle did not list the cities most likely to be selected but said that those with existing stadiums or approved stadium plans would have the best chance for expansion teams.

Oakland, Memphis, Jacksonville and Phoenix have stadiums and are actively seeking franchises.

Belgrad said he will be leading a delegation to the NFL owners meeting next month in Kansas City, Mo. Schaefer said that he might go as well, and he added that "many of the owners, I think, are with us." Schaefer said he believes that NFL owners are sympathetic to Baltimore because of the way Colts owner Robert Irsay moved his team from the city to Indianapolis in 1984 -- by loading the team's belongings into moving vans in the dead of night.

There has been some speculation that the NFL will eventually expand by four teams, two in 1989 and two later.

Miami Dolphins owner Joe Robbie said last week on a Baltimore television show that Oakland, Memphis and Phoenix are competing in the first tier and that Baltimore is in the second.

Petition drive leaders Denis and William A. Marker, a Baltimore lawyer who headed Marylanders for Sports Sanity, worried that the court's decision virtually ends the public's right to petition acts of the legislature with which they disagree. "It just about emasculates the right" of referendum, Marker said.

But Lt. Gov. Melvin A. Steinberg said the constitution was right in keeping residents from demanding referendums on budget decisions that in effect keep government operating.

As for checks and balances, Steinberg said, the "check and balance is at the ballot box."

Schaefer said he hoped that those who opposed the stadium project will help the state land an NFL franchise. "I personally, honestly think {the stadium project} is something good for the state, not only for the City of Baltimore," Schaefer said.