In an attempt to end an escalating controversy over alleged improprieties in the selection of a contractor to oversee construction of the Baltimore subway, the state of Maryland today decided to do the job itself.

The state Board of Public Works decided to develop a unit within the government to supervise the project instead of awarding a $25 million contract to private firm.

The allegations, which were made last week by Maryland Transportation Secretary Harry R.Hughes as he resigned in protest, threatened to fatally delay construction of the project with litigation and a possible federal inquiry.

They also wereexpected to be potentially damaging to the gubernatorial campaigns of state Comptroller Louis L. Goldstein, a member of the board and Lt. Gov. Blair Lee III, who acted for Gov. Marvin Mandel in making the decision today.

Hughes charged that Victor Frenkil, a Baltimore contractor and personal friend of Goldstein and Mandel, had "tainted" and "tampered with" the painstaking process of selecting a contractor in an effort to win a piece of the lucrative contract

Among other things, Frenkil was alleged to have warned a competing contractor - The Ralph M. Parsons Co. - That it would never receive the contract unless it included Frenkil as part of its team.

The Parsons team was eventually selected by Hughes' department as the most qualified for the contract, despite the absence of Frenkil, who joined a competing consortium. Today's decision apparently guaranteed that neither Parsons or Frenkil would get the contract.

Hughes had criticized the board, headed by his boss, Mandel, for repeatedly refusing to ratify the transportation department's selection. He has said that he believes Frenkil is resposible for the board's position, although he has that assertion. It has been denied by board members.

Frenkil was the target of a massive federal investigation in the early '70s after it was alleged that he used bribes and threats to obtain payment of cost overruns his company incurred in building a Hous of Representatives parking garage. Maryland U.S. Attorney Stephen H. Sachs said then that a proposed indictment of Frenkil was blocked by then Attorney General John N. Mitchell.

"We are not going to hire any consultant firm, consortium, joint venture or anything . . . to provide management overview for this series of projects for the Baltimore mass trasit system," Lee said in announcing the board's decision.

In subsequent interviews, however, both Lee and Goldstein refused to rule out the possibility that individuals from one of the five competing firms might be hired by the state to work on the subway project.

The state had once before considered doing the construction supervision itself, but had rejected the idea as impractical and too expensive. Today's decision negated over two years of preparation that went into the selection of the Parsons company under a process set up in 1974 to prevent repetition of Agnew-style kickback scandals in Maryland.

The $721 million subway construction project that the unit will oversee is the largest public works job in Maryland history.

Lee conceded yesterday that the salaries for about 15 "top-level" consultants the state must hire will be "shocking," but said it would be less expensive than an outside contractor. "We are now doing what we probably should have done at the beginning," he said.

Hughes' resignation marked the first time a high-ranking member of the Mandel administration has quit in public protest over what he believed to be a matter of principle.

Thursday, Hughes told a committee of the General Assembly that the Board of Public Works - which includes Mandel, Goldstein and William S. James, the state treasurer, had "twisted and distorted" state regulations in refusing for months to award the contract to the Parsons firm.

Board members disputed this, contending that the criteria the transportation department used in selecting the Parsons film were insufficient for comparing various proposals. As of two weeks ago, Lee said that the board was prepared to begin the process of considering contractors all over again.

The Hughes resignation apparently convinced the board to try to defuse the entire matter by having the state do the work. The Parsons firm had threatened to sue the state and the federal General Accounting Office was preparing to investigate the entire process because federal funds are being used by the state.

Joseph Volpe, Jr., a Parsons official who had been vociferous in his criticism of the board's handling of the contract, said today that the state had "turned full circle because they're determined not to approve the Parsons contract." Lee said the main reason was to avoid the delay of litigation.

"A long time ago the MTA officials and the state Department of Transportation made it clear that the most efficient and economical way to accomplish this whole thing is to go to outside consultant firms," Volpe added.

Volpe said that he and his colleagues had to consider, in light of the board's action, whether or not the Parsons consortium should sue the state. "There was a lot of money and effort put into this. It was done in good faith and then the state changes its mind without good reason," he said.

Frenkil could not be reached for comment on his reaction to the board's decision..

Instead of delaying the project, Lee said, "this is about the only thing that will speed it up." Some construction work has already started, and tunneling is scheduled to begin next month.

Two uncertainties that remain, however, are whether the state's personnel procedures can be bent or waived to allow formation of the new oversight group, and whether the federal agency that is scheduled to fund 80 per cent of the project, or about $600 million, will agree to the new set-up.

The federal Urban Mass Transit Administration had already balked severals ago at the hiring of any more subcontrators, before a managing contractor had been agreed on.

A spokesman for acting UMTA director Charles F. Bingman said yesterday that the new proposal "certainly seems feasible," although any final decision would have to be based on a written proposal.

The Hughes resignation hit the Mandel administration at a time when it is already drawing daily headlines with scandal allegations. Mandel and five of his friends are currently awaiting the conclusion of jury selection in their federal political corruption trial.

A former top Mandel aide, Alford R. Carey, Jr., once head of the state's school construction program, is on trial in Annapolis on charges that he accepted bribes in exchange for contracts.