The Senate, inching its way through amendments to a $177.9 billion defense authorization bill, yesterday approved by unanimous voice vote a measure that would bar young men who fail to register for the draft from receiving federal education aid.

"With rights and benefits come responsibilities," Sen. S. I. Hayakawa (R-Calif.) said in urging approval of the measure, which he co-sponsored with Sen. Mack Mattingly (R-Ga.).

Passage of the aid restriction came as the Senate worked on amendments to the bill, which earmarks money for weapons research and purchases, military operations and maintenance, and civil defense.

As first reported by the Armed Services Committee, the bill totaled nearly $180.3 billion. But the panel took the measure back and made cuts to help it conform with a Republican budget ceiling plan.

The Senate voted, 95 to 0, to create an independent inspector general's office in the Defense Department to serve as watchdog over the Pentagon's multibillion-dollar operations.

Most other major federal departments have such offices, but the Defense Department has resisted it.

Armed Services Committee Chairman John G. Tower (R-Tex.) voted for the plan but warned of possible interference with the "command and control structure of the Department of Defense."

Supporters of the amendment by Sen. William V. Roth Jr. (R-Del.) said the huge Pentagon budget needs close watch by independent auditors and investigators.

Sen. David H. Pryor (D-Ark.) said the plan would not require new personnel because it would merely consolidate in one new office the nearly 4,000 auditors and related personnel working for several scattered agencies.

Under the plan, the secretary of defense could veto a planned audit or investigation if he thought it would compromise national security, but he would have to report his reasons to Congress.

The Senate also defeated, 54 to 40, an attempt by Sen. Robert J. Dole (R-Kan.) to delete $80 million the Armed Services Committee had added to keep the 52 aging Titan II missiles in place through September, 1983.

The administration plans to retire one of those missiles a month starting this October and had sought only $21 million for Titan operations.

Dole argued that the missiles, based in silos in his state, Arkansas and Arizona, are outmoded and dangerous because they are deteriorating. He reminded the Senate of accidents involving fuel leaks or explosions at some Titan sites.

Sen. J. James Exon (D-Neb.) said the Titans represent one-third of the total explosive force of the U.S. nuclear missile arsenal and should not be given up without some concession from the Soviet Union.