A D.C. Superior Court judge ruled yesterday that Mayor Walter E, Washington illegally withheld authority to spend school funds in 1975 and 1976, which the D.C. Board of Education contents amounted to as impoundment of $4.6 million.

Judge James A. Belson, in a 37-page order said that a hiring freeze insposed by Washington then clearly violated the city's Home Rule Charter, which gives the board the sole authority to decide how it will spend money allocated by Congress for the public schools.

Belson said he will refer the case in 45 days to an auditor appointed by the court to determine how much money should be available to the board as a result of his decision. In so doing, Belson said, he will leave room for the possibility that the board may decide not to use its spending authority now, or that the board and the city may agree between themselves on the amount of money due.

In his opinion, Belson firmly established the school board's budgetry independence and said he agreed "that the mayor has trenched impermissibly upon the board's budgetry autonomy."

Belson asaid it appears that the school board, unlike all other city agencies can contend validly that the terms of the Home Rule Charter.

"The exceptional status of the Board in this regard mandates the conclusion that in attempting to meet that apparent challenge to the District's fiscal integrity in fiscal year 1976, the mayor could not treat the board as if it were just another city agency," Belson said.

While the mayor and council can set the maximum amount of funds to be spent by the board annually, they have no authority under any law to tell the school board how much of that money should be spent or what programs should be funded, Belson said.

"It's a victory of the children of this city," said Conrad P. Smith, president of the board of education.

"What we on the board of education have been saying for years is that the (board) is an independent agency and once it gets its budget . . . it has the authority and the right to spend that money on behalf of the children," Smith said in a telephone interview yesterday.

A spokeswoman for Washington's office said the mayor had not had a chance to read Belson's decision and could not comment on it. Acting D.C. Corporation Counsel Louis P. Robbins, whose office represented city officials in the case also declined to comment on the order.

Belson's ruling came in a lawsuit filed in September 1976 by present and former members of the city school board against the mayor, city administrator Julian R. Dugas, and Comer S. Coppie the director of the city's Office of Budget and Management Systems.

The dispute centers on an order, issued by the mayor in July 1975 that placed a hiring freeze on all city agencies, including the Board of Education and imposed strict limits on spending authority for other purposes, according to Belson's ruling.

In September 1976, the board blamed a walkout by school custodians on hiring restrictions imposed by the mayor's job freeze. The spending cutbacks also ruled out the purchasa of needed school supplies and expenditures slated for a computer system, said David A. Split, the school boards's general counsel.