Secretary of State George P. Shultz yesterday took angry exception to the idea that "somebody's head has to roll" for the Sept. 20 bombing of the U.S. Embassy annex in Beirut, saying, "I'm willing to have it be my head anytime anyone wants."

Shultz, who is noted for a normally softspoken and even-tempered manner, reacted with uncharacteristic emotion as questions about whether there was lax security at the embassy continued to dog the Reagan administration.

Democratic presidential nominee Walter F. Mondale charged yesterday that President Reagan, despite his denials, had tried to put the blame on past administrations for allegedly weakening the CIA's ability to collect intelligence.

"Presidential leadership means being accountable for events that occur on your watch," Mondale said in his weekly paid radio speech. "There was not a failure of American intelligence; there was a failure to use it wisely."

Shultz became visibly upset when questioned on "This Week With David Brinkley" (ABC, WJLA) about how terrorists had been been able to carry out their third major attack against Americans in Lebanon within 17 months. He replied sharply:

"There is somehow this notion that in response to this, somebody's head has to roll. Well maybe so. And I'm willing to have it be my head anytime anyone wants . . . . I certainly feel responsible. Absolutely. And I take that responsibility very seriously.

"Just you listen to me now -- I feel so strongly about this," he said when questioners tried to interrupt. "The people out there in Beirut are serving our country in a risky environment . . . and they are doing everything possible to improve their security and it's up to us to help them . . . .

"There is an investigation . . . .If there was negligence, we'll find it. But we're not in this investigation business to see if we can knock somebody's head off. Our purpose is to find out what additional we can do to enhance the security of our embassies. That's the bull on which we need to keep our eye."

Shultz's testy exchange with his interviewers followed a week in which the Beirut bombing has become a subject of increasingly partisan exchanges between Republicans and Democrats.

At one point, Reagan appeared to be blaming former president Jimmy Carter's administration for allegedly weakening the CIA. But after demurrers from CIA Director William J. Casey and Vice President Bush, who headed the agency in the mid-1970s, the administration said Reagan's remark had been misinterpreted, and Reagan called Carter to explain.

Mondale yesterday called the idea that previous administrations were to blame "false, misguided and dangerous. It is not true that the CIA was weakened during the late 1970s, as Mr. Reagan's own vice president and CIA director have admitted."

"It is reckless to announce that American intelligence is so weak that we cannot protect ourselves from terrorists," said Mondale, who was Carter's vice president. "That invites further assaults. It jeopardizes the security of our personnel and installations abroad."

Bush, at a news conference in Parma, Ohio, yesterday, said Reagan would "probably" take responsibility for the bombing, if necessary, but added that such terrorist attacks are "extraordinarily difficult to guard against," United Press International reported.

In addition to the injection of the bombing issue into the presidential campaign, there have been indications that groups within the administration are trying to extricate themselves from suspicion of laxity by shifting the blame to rival agencies.

Some State Department officials said that might have been a factor in prompting Shultz's angry remarks.

Department officials are known to be particularly incensed at the leak to the press, immediately after the bombing, of a Defense Intelligence Agency report citing security deficiencies at the embassy annex. State Department officials said privately that the report contained no information of which they were unaware and added that, although it had been completed two weeks before the bombing, they had been unable to obtain a copy from the DIA.

As a result, many department officials are known to feel that the leak was an attempt by elements within the Defense Department, and possibly the CIA, to make it appear that the blame rests solely with the State Department and embassy personnel in Beirut.

Shultz, in his remarks yesterday, pointedly called the U.S. ambassador there, Reginald Bartholomew, "a hero." The secretary said Bartholomew had "come close to getting killed three times."

In response to questions about Reagan's meeting Friday with Soviet Foreign Minister Andrei A. Gromyko, Shultz reiterated the administration's contention that the meeting had resulted in an important agreement "to keep in touch. . . carefully and systematically through diplomatic channels." As a result, Shultz added, "we hope we can negotiate out some important things" like a resumption of arms control talks in the months ahead.

Shultz dismissed as "just nonsense" a Washington Post article yesterday that said the White House had kept arrangements for Gromyko's visit secret to prevent the Defense Department from torpedoing the meeting. "The Defense Department was completely involved in the preparations," he said, although he acknowledged that in the early planning stages "the president kept it to himself and a few other people."

Robert C. McFarlane, Reagan's national security affairs adviser, said on "Face the Nation" (CBS, WDVM) that he expected the talks with Gromyko to lead to "a steady discourse of increasing value." McFarlane predicted that concrete results are likely to start becoming evident in a "couple of months."

However, Mondale charged that the meeting was "disappointing in that no progress was made." He called on Reagan to give the American people an accounting, saying: "The president should answer what happened and why it failed."