Defense Secretary Caspar W. Weinberger said yesterday that he strongly opposes pending budget-balancing legislation, including the Senate-passed version that President Reagan has endorsed, as he clashed repeatedly with members of the Senate Armed Services Committee on this and other subjects.

Weinberger indicated he would recommend that Reagan veto the Senate-approved Gramm-Rudman-Hollings antideficit measure if it should pass the full Congress. The measure is named for primary sponsors Phil Gramm (R-Tex.), Warren B. Rudman (R-N.H.) and Ernest F. Hollings (D-S.C.)

Weinberger's stepped-up public attack on Gramm-Rudman-Hollings came during hearings on the committee's proposals to reform the Pentagon. The hearing ended with Chairman Barry Goldwater (R-Ariz.) complaining that Weinberger did not seem to have read the committee report.

"You better go back and read this report of ours," Goldwater rasped. "We're going to get you back again. We want some answers."

This testy ending contrasted with the spirit of accommodation Weinberger projected at the outset of the hearing, declaring at one point that he could go along about half of the committee recommendations designed to improve military procurement and readiness. He opposed, however, the report's plan to eliminate the Joint Chiefs of Staff. He added that Reagan has expressed no dissatisfaction with the chiefs or their organizational structure.

Weinberger also expressed opposition to Gramm-Rudman-Hollings before his committee testimony in a private breakfast meeting with White House Chief of Staff Donald T. Regan and other Cabinet members, informed officials said. His committee testimony came as members hopscotched from topic to topic with the defense secretary, who for almost five years has been fighting attempts to hold down his budget.

"I'm very strongly opposed to across-the-board approaches," Weinberger said of the measure, which would require the president to cut defense as well as non-defense programs proportionally if the federal deficit exceeded certain limits. He added that, given this opposition, "it doesn't take a great deal of cryptographic work" to determine whether he would recommend that Reagan veto Gramm-Rudman-Hollings.

"Is the administration position the same as yours in opposing Gramm-Rudman with the Levin amendment requiring across-the-board reductions -- yes or no?" Sen. Edward M. Kennedy (D-Mass.) asked Weinberger.

"I'm not aware of any difference between my position and the administration on these matters," Weinberger responded. "The president has said repeatedly that whatever formula is adopted, it is essential" that defense budget increases of 3 percent above inflation for fiscal 1987 and 1988 "be preserved."

"No chance, no chance," said Sen. J. James Exon (D-Neb.), saying that such increases could not be maintained under any of the various "budget-wrenching" measures before Congress.

Weinberger said the president cannot gamble with the nation's safety by treating defense and nondefense programs alike. He added that the across-the-board feature in Gramm-Rudman-Hollings, inserted in the Senate-passed measure through an amendment by Sen. Carl Levin (D-Mich.), would deny the president "the flexibility to assign national priorities -- one of the things for which he is elected."

The defense secretary also clashed repeatedly with Sen. Sam Nunn (D-Ga.), the committee's ranking Democrat, on whether inadequate radios hampered U.S. military forces during the invasion of Grenada in 1983.

"They were not hampered significantly," Weinberger testified.

"That is directly contradictory to your own Department of Defense report," Nunn said, holding up a thick, mostly secret after-action report on the Grenada operation. "You are making unclassified statements that are completely rebutted by classified material."

"To say those communications problems interfered with the success of the operation is to fly in the face of the facts," Weinberger said.

"That's very crafty wording," Nunn snapped, his voice rising. "The operation was successful; therefore, nothing interfered with the success of the operation because it was successful. That's a ridiculous way to examine problems. I won't play on that ball field. I congratulate you as a lawyer, but as a secretary of defense I don't think that's an appropriate method by which to succeed" in solving problems.

"You have to keep a sense of proportion about whether there was anything in the system that caused those errors or whether they are simply inherent in any large-scale operation that is put together very, very quickly," Weinberger replied. The Grenada operation "went extremely well overall," he said