Defense Secretary Caspar W. Weinberger acknowledged yesterday that the Pentagon has paid "far more than we needed to" for spare parts, and said the Navy has replaced one commander and would discipline other officials because of the problem.

Weinberger blamed most of the embarrassing overcharges on spending practices and contracts of previous administrations. He said he has taken aggressive action to increase competition and cost-consciousness in purchasing of spare parts.

"We're going to take whatever corrective action is necessary," he said. "There certainly have been some horror stories . . . ."

Weinberger held a Pentagon news conference to respond to recent reports from his inspector general's office, which found a pattern of rapid and unexplained price increases in spare parts purchased from monopoly suppliers.

Auditors found, for instance, that last year the Air Force paid $17.59 for a bolt that cost 67 cents in 1980, and that the Navy spent $110 for a diode it could have bought for 4 cents from its stockrooms.

Those reports, coupled with a conclusion by the President's Private Sector Survey on Cost Control that the Pentagon could save $28 billion each year, have put the Pentagon on the defensive as Congress resumes debate on its $99 billion military procurement request. A draft report from the office of Defense Inspector General Joseph H. Sherick found that in many cases "little effort was being made to limit exorbitant cost growth."

The reports, which examined Air Force and Navy purchases of spare parts for jet engines and Navy purchases of F/A18 jet flight-simulator parts, said the Pentagon has done little to stimulate competition among suppliers and has emphasized speed instead of cost.

"Nobody has paid too much attention, or nearly enough attention, to price or additional sources of supply," Weinberger said yesterday. "So cost-consciousness has to be and is being instilled very rapidly in the personnel who are involved in the process."

Weinberger said Navy Secretary John F. Lehman Jr. yesterday relieved of command the officer in charge of the F/A flight-simulator program. Navy officials said later that they do not know if the officer has been reassigned.

In addition, the former chief of the Navy Training and Equipment Center will be disciplined, Navy officials said. That captain was routinely reassigned in March to one of the top purchasing jobs in the Navy's material headquarters, officials said, and had heard nothing about a proposed reprimand until after Weinberger's news conference.

Weinberger blamed many of the parts purchasing problems on "bad contracts that we found when we came" and on the dwindling number of defense suppliers resulting from decreased military spending during the 1970s. He said his administration has increased the proportion of aviation parts purchased competitively from 6 percent to 17 percent and the share of competitive shipbuilding contracts from 27 percent to 60 percent.

The inspector general's report criticized the Pentagon for not seeking available competition and for claiming competition when one contractor bids against an affiliated licensee.

Weinberger also said the Pentagon would seek to recover funds by withholding future payments and might disqualify some suppliers and discipline more employes. "There will be nobody who is free from careful examination of all of his activities during all the time," he said.