Five Republican senators warned senior defense and military officials yesterday that recent "horror stories" on spare-parts overcharges have endangered the "national consensus" on defense spending. One of the five, Sen. Alfonse M. D'Amato (R-N.Y.), said he might have to reconsider his support for some big-ticket military projects.

"I suggest to you--because I vote for those weapons systems that are somewhat controversial, and I support them consistently--that it's going to be pretty tough for a senator like myself to be able to support them if the confidence in the public erodes and they say, 'These are wasted,' " D'Amato said.

Joining him in expressing concern were Majority Whip Ted Stevens (R-Alaska) and Sens. Lowell P. Weicker Jr. (R-Conn.), Robert W. Kasten Jr. (R-Wis.) and Warren B. Rudman (R-N.H.).

They sounded their warnings at an Appropriations defense subcommittee hearing called to address a series of embarrassing revelations about the purchase of military spare parts. Celebrated cases in the past month included the payment of $110 to Sperry Corp. for a 4-cent diode and of more than $430 each to Gould Inc. for an ordinary claw hammer and a 12-foot measuring tape.

The senators reserved their harshest language for the private contractors who set these "outrageous" prices. Three senators--D'Amato, Rudman and Stevens--used the word "fraud," and Rudman asked Defense Inspector General Joseph H. Sherick to consider seeking a grand jury investigation that could lead to criminal indictments.

"I don't understand how someone in the business community who is dealing in good faith with the military can be charging some of the prices that they have been charging without bordering on fraud," Rudman said. "I'd like to see whether or not we can teach some people a lesson."

"I think we should sue them," D'Amato said. " . . . They should know that if they're going to engage in conduct that is nothing more than theft, they're going to pay the price."

There was considerable anger and frustration on the part of subcommittee members as the five Republicans and one Democrat--Sen. William Proxmire (D-Wis.)--sharply questioned a panel of defense officials headed by Mary Ann Gilleece, deputy undersecretary for acquisition and management.

The officials stressed longstanding management initiatives to cut costs, and cited Defense Secretary Caspar W. Weinberger's new 10-point spare-parts plan as evidence that matters are under control.

"It is not sufficient for this committee," Stevens replied, "to tell us we've had adequate protection for 10 years, because it's not working."

Sherick, commenting publicly for the first time since the widespread leak last month of his draft report on spare-parts overpricing, emphasized the department's bureaucratic problems. "Obviously, somebody is asleep at the switch," he said.

In recent weeks, Navy Secretary John F. Lehman Jr. has written to Sperry and to Gould, seeking repayment of "ludicrous" charges for spare parts. The companies have responded, in part, by saying that they average overhead costs on all parts, leading to overcharges on some and undercharges on others.

"I can understand the explanation," Sherick said yesterday. "I just don't buy it."

Some senators and witnesses blamed the "computerization" and "depersonalization" of defense procurement for confusion leading to the overcharges.

Stevens, waving a pencil and quoting a cartoon, said, "As a spare part this is a 'portable, hand-held communication enscriber,' " and asked if that is not a type of fraud.

"I think if it's fraud we commit it on ourselves," Sherick replied. "We name and identify these things."