Prime Minister Menachem Begin's scolding tirade to U.S. Ambassador Samuel Lewis and his decision to make public a transcript of the dressing down were touched off primarily by a cable from Washington linking the restoration of the U.S.-Israeli strategic cooperation agreement to Israeli flexibility in peace negotiations and military restraint in Lebanon, informed sources said today.

Despite the appearance of spontaneity of Begin's 40-minute tirade, an aide to the prime minister said, it was carefully prepared with the intention of making it public.

The sources said the cable that angered Begin was sent by U.S. Secretary of State Alexander M. Haig Jr. to Israeli Foreign Minister Yitzhak Shamir on Friday, when the United States suspended the recently signed cooperation agreement as a sanction against Israel for annexing the Golan Heights.

The linkage idea was not put forth publicly by the U.S. government but was described to reporters in background sessions with State Department officials. It was explicitly contained in Haig's cable to Shamir and another cable sent to the foreign minister by Israel's ambassador to Washington, Ephraim Evron, detailing Washington's reaction to the Golan Heights annexation, Foreign Ministry sources said.

The linkage, which Begin interpreted as tantamount to political blackmail, infuriated the prime minister so much that he decided to put his credibility on the line and treat the strategic accord, which he had personally billed as paramount to Israel's security, as dispensable.

"There was a definite link, and that is what infuriated him. It was a public slap in the face, and it made all our future positions in the Palestinian autonomy talks and our military options in Lebanon hostage to the strategic agreement," an aide to the prime minister said.

The Reagan administration's judgment on whether to restore the strategic accord, both Haig's and Evron's cables said, would be affected by the "overall situation in the Middle East," including adherence to the Camp David peace accords, progress in negotiations for West Bank and Gaza Strip autonomy and events in Lebanon.

The Shinui faction, with two members in the 120-member Knesset, or parliament, said it would introduce a vote of no-confidence over Begin's handling of relations with the United States. The Labor Party, the largest oppostion group with 48 members, announced that it would support the motion.

Begin was advised of the Haig cable Friday night, and by the next morning he had decided to summon Lewis on Sunday morning, after the Sabbath, and inform him that Israel regards the strategic accord as canceled. Even then, sources close to the prime minister said, the prime minister had decided to derive the maximum impact by immediately making public his admonishment of Lewis, and he ordered an English-speaking stenographer to be present at the prime minister's residence, where Begin is recuperating from a broken thigh.

Begin's speech, in which the prime minister demanded to know whether the United States considered Israel a "vassal state" or a "banana republic," was carefully prepared in outline form and studied by Begin over the weekend.

"It may have looked like it was Begin flying off the handle, but it was well thought through from beginning to end," an aide to the prime minister said. He added that Begin "knew he had to put an end once and for all to this continuous cycle of degrading punishment of Israel by the Americans, and that he had to do it as dramatically as possible."

Lewis, who had been upbraided by Begin before during the past five years, reportedly was not surprised by the tone of the prime minister's remarks, or even the content. But the ambassador was said to be surprised that Begin's message, presented as a position to be relayed to Haig, was transcribed and read to waiting reporters even before the ambassador had had time to return to his office in Tel Aviv.

Israeli government sources said Begin was as much concerned about what he viewed as U.S. attempts to control Israel's options in Lebanon as he was about the linkage to Israeli flexibility in the autonomy talks. Following the parliament's annexation of the Golan Heights, the Israeli Army has redeployed troops and armor along the northern border in anticipation of possible retaliatory action by the Palestine Liberation Organization, and there is a widely held perception among Begin's advisers that the U.S. sanctions were intended to warn Israel against making a preemptive strike into south Lebanon.

Meanwhile, former prime minister Yitzhak Rabin said today that the United States is trying to use the U.S.-Israeli friction over the Golan Heights issue as an "excuse" for deviating from the Camp David accords and, possibly, including the PLO in Middle East peace negotiations.

Rabin, a Labor Party member of the Knesset said that while he regards the Golan Heights annexation as unnecessary at this time, it "serves as an additional excuse for the United States to depart from the Camp David accords." He said U.S. intentions had already been signaled by Reagan administration officials who have spoken of the need to expand the peace process, and by officials who supported the Saudi Arabian peace proposals.

"It is the beginning of the end of the Camp David process ," Rabin said in an Israeli radio interview. "The main reason was American policy, but unfortunately we helped it, and we gave an excuse to the United States to go its own way even though it might have been otherwise."