For two arduous months, the Senate Armed Services Committee wrestled with some of the toughest national security issues facing the nation. Example: Should the vice chairman of the Joint Chiefs of Staff be allowed to attend White House meetings as acting chairman when the chairman is out of town?

"That was one of the great battles that we won, on some very close votes," Sen. Carl Levin (D-Mich.) reported last week.

Those who are not well schooled in the arcana of defense reorganization may wonder how such debate could lead to "sweeping and historic" measures, as Sen. Sam Nunn (D-Ga.) said, or to what committee Chairman Barry Goldwater (R-Ariz.) called "the most significant piece of defense organization legislation in the nation's history."

Even Nunn acknowledged that the defense management revisions approved by his committee would, even if passed into law unchanged, only partly remedy the most glaring absurdities of interservice rivalry. It remains to be seen, that is, whether the Goldwater-Nunn changes will force the Army and Navy to buy radios that can communicate on the same frequency, a problem that emerged during the 1983 Grenada invasion.

"There's no such thing as passing a piece of legislation for a vast organization, and then all of a sudden everybody adopting it in spirit and marching out and it cures all the problems," Nunn said after the committee unanimously approved its most significant reorganization effort in 28 years. "I'd be the last to say that. It may take five or 10 years for this really to be set."

But even modest steps in military reform arouse great emotion. Marine Commandant Gen. P.X. Kelley said he "would have deep concerns for the future security of the United States" if the Goldwater-Nunn bill were approved. Beneath the apparent minutiae involving vice chairmen and acting chairmen lie longstanding jealousies, embedded rivalries and the most basic disputes about who should exercise power in the military world.

Goaded by the embarrassments of "$600 toilet seats and $3,000 coffee grinders," as Goldwater said, the defense establishment now seems likely to implement some changes this year. The House, the Senate Armed Services Committee and a White House commission led by businessman David Packard have found grave problems in Pentagon management and endorsed changes intended to force the four military branches to cooperate more and compete less.

The Packard commission, which President Reagan hoped would rally support for his arms buildup, concluded last month that the Defense Department does a poor job of buying weapons.

"With notable exceptions, weapon systems take too long and cost too much to produce," the panel said. "The well-publicized spare parts cases are only one relatively small aspect of a far costlier structural problem."

But if $600 toilet seats have aroused public interest, the debate about chain of command, not procurement, arouses the most heat inside the military. It is a debate that has been waged at least since 1947, when Cabinet-level secretaries of navy and war were reluctantly married in one department of defense.

So when Nunn and Goldwater seek to give more authority to the chairman of the Joint Chiefs and his theater commanders to enhance joint planning and cooperation, service authority is threatened. The Navy Department, which essentially has its own army (the Marines Corps) and air force (the carrier-based air wings), has always resisted integration most strenuously.

Navy Secretary John F. Lehman Jr., who lobbied vociferously against the Goldwater-Nunn reorganization, argued that more "jointness" would produce more bloat and less efficiency. The services are so large, he said, that ladling more headquarters staffs on top can only make things worse.

But the Senate committee worried more about each branch buying separate weapons for the same mission, each demanding a role in every skirmish, each hoarding its own intelligence. "Military operations stretching over time from the Spanish-American War to the attack at Pearl Harbor to the Iran hostage rescue mission to Grenada have proven that weak interservice cooperation has not been unique to any one presidency or administration," Nunn said.

And so the battle goes on. If a vice chairman serves as acting chairman, then the service chiefs, who currently share the honor on a rotating basis, will lose some access to the president. That is a small piece of authority that the chiefs will defend with every weapon at their command.