The former head of the Justice Department's criminal division said Tuesday he had told Edwin Meese III in resigning that he thought the attorney general had probably committed felonies in doing favors for his longtime friend, E. Robert Wallach.

"I advised Mr. Meese on the day I resigned," said former Assistant Attorney General William Weld, that Wallach had "certainly" violated the federal law barring the giving of gratuities to public officials in exchange for official acts and that Meese "probably had violated the statute as well."Weld said that as a lesser Justice Department official he had won convictions of Massachusetts building inspectors and a congressman with less evidence on the same charge.

Weld listed for the Senate Judiciary Committee 63 items of fact concerning the attorney general's relationship with Wallach that Weld said bolstered his contention that Meese had violated ethics regulations and probably had violated the gratuities statute.

Weld questioned Meese's actions in assisting the scandal-plagued Wedtech Corp., an Iraqi oil pipeline project and regional Bell telephone companies.

Another top aide, who resigned with Weld, told the committee he had quit because the department's morale and performance were deteriorating due to Meese's legal problems.

That aide, former Deputy Assistant Attorney General Arnold Burns, testified that, "from my vantage point, I could see that performance by the Department of Justice was being impeded by a deep malaise that was setting in by virtue of Mr. Meese's problems and the public outcry for his resignation."

Weld told the committee that Meese had certainly violated federal ethics guidelines prohibiting public officials from committing acts that give any appearance of impropriety.

"Because I had concluded that Mr. Meese's conduct over the years had given the appearance of partiality to Mr. Wallach and constituted the use of Mr. Meese's public office for Mr. Wallach's private gain, I would have resigned from the Justice Department when I did irrespective of whether I had felt Mr. Meese's conduct also infringed upon the provisions of the gratuity statute.

"A possible defense against a gratuity charge being applied to Mr. Meese is that all of the things of value he received from Mr. Wallach were done in the

name of friendship and had no relation to any of the official acts performed by Mr. Meese which benefited Mr. Wallach," Weld said.

"My conclusion was that there were simply too many official acts performed by Mr. Meese to benefit Mr. Wallach, and too many things of value conferred by Mr. Wallach on Mr. Meese, for a prosecutor to conclude as a matter of fact or law that the gratuity provisions . . . would not apply.

"Not only did Mr. Meese perform many official acts for the benefit of Mr. Wallach, but his efforts in that regard were unusual, in the case of" Wedtech, the oil pipeline and Meese's decision, following a receipt of a memo from Wallach, on behalf of the regional Bell telephone companies.

"In return, Mr. Wallach appears to have become, over time, the financial `Johnny-on-the-spot' for Mr. Meese," said Weld.

According to Weld as well as an 814-page report by independent counsel James McKay, some of the items of value that were provided to Meese by Wallach included legal services for which Wallach did not charge Meese, arranging to provide Meese with the services of financial manager W. Franklyn Chinn and helping arrange a $40,000-a-year job for Meese's wife, Ursula.

Weld said that he had outlined his views of Meese's culpability to President Reagan and Vice President Bush, as well as congressional leaders and other White House aides.

Breaking the federal gratuity law is a felony punishable by up to two years in prison.