After a tumultuous parliamentary debate airing some of the harshest criticism ever voiced of his government, Prime Minister Menachem Begin today beat back opposition calls for an independent inquiry into the massacre of Palestinians last week and for full-scale examination of the decision to move troops into West Beirut.

While prevailing in the two Knesset votes, Begin's government was jolted by the resignations of Energy Minister Yitzhak Berman and Menachem Milson, the controversial head of the Israeli civil administration in the West Bank, in protest over the inquiry issue.

The actions came as Arabs protested the massacres by an upsurge of violence throughout Israel and the West Bank.

Defense Minister Ariel Sharon, in defending the decision to send Israeli troops into the Moslem sector of the Lebanese capital, fueled further controversy by providing the most complete account yet from an Israeli official of the extent of Israeli cooperation with the Christian militia forces who carried out the massacre of hundreds of men, women and children.

To avert the threatened defection from his government coalition of the National Religious Party, Begin reluctantly agreed to allow an internal investigation into the refugee camp killings. The move allowed his ruling Likud Bloc to defeat by a vote of 48 to 42 an opposition motion to establish an independent judicial board of inquiry into Israel's actions in connection with the slaughter of the refugees by Lebanese Christian militiamen.

Begin and his Cabinet remain strongly opposed to such an independent inquiry and are expected to propose a lower-level probe under tight government control.

The resignation of Milson, a Hebrew University professor who was named to head the new civil administration in the West Bank and Gaza when it was created last year, came as a surprise.

His spokesman, Achiya Yitzhaki, said Milson had decided he could no longer remain in a job of "trying to make peace with the Palestinians" while the Israeli government refused to investigate the Beirut massacre.

Earlier in the day, the Knesset voted 47 to 40 to reject a Labor Party attempt to initiate a full debate on the decision to dispatch Israeli troops into West Beirut after the assassination of Lebanese president-elect Bashir Gemayel.

In that debate, Sharon acknowledged that last Wednesday, the day Israeli forces entered West Beirut, Israeli officers held the first of two coordinating meetings with officers of the Christian Phalangist militia.

A second meeting was held Thursday, he said, adding that that night Israeli forces fired flares from mortars to light the camp as the Phalangist militiamen entered the Shatila refugee area on the southern outskirts of Beirut. Sharon referred only to the Phalangist militia and to the Shatila neighborhood.

There was also widespread killing at the nearby Sabra refugee center, and, according to eyewitness accounts from Beirut, the militiamen included forces commanded by Israel's other Lebanese Christian ally, renegade major Saad Haddad.

The defense minister said the Phalangist militiamen were instructed by Israeli officers to seek out Palestinian guerrillas and were warned that "no harm should be done to the civilian population, especially to women, children and old people."

Sharon said that by late Friday morning the Israeli Army's northern commander, Gen. Amir Drori, had become suspicious of what was happening inside the Shatila area and ordered a halt to Phalangist activity. But at a meeting with Phalangist officers later that day, Sharon said, it was decided to allow the militiamen to remain in the refugee center until Saturday morning.

"At this meeting, too," Sharon said, "there was no knowledge of events at the Shatila camp."

The defense minister said the Phalangist militia was sent into the refugee neighborhoods to safeguard the lives of Israeli soldiers, who would not have to confront the remaining Palestinian guerrillas.

"We did not in our wildest imagination dream that the Phalangists would do this," he said. "They looked like a regular Army and promised to fight the terrorists."

Sharon's account of last week's events contradicted a variety of earlier versions by other Israeli officials, who had claimed that Israel had no knowledge of and played no role in the entry of the Christian militiamen into the refugee areas.

Sharon is also the first Israeli official to acknowledge publicly that the militia forces remained inside the refugee neighborhoods until Saturday morning, some 36 hours after they entered through Israeli lines.

From the moment the Knesset convened this morning, the atmosphere turned bitterly personal. Before the debate began, Tawfik Toubi, an Israeli Arab and member of the country's small Communist Party, strode to the podium and began shouting for Begin and Sharon to resign "because you are accomplices to murder." Knesset security officers dragged him away.

Labor Party leader Shimon Peres, delivering a speech that was greeted with unusual quiet and attention given the normally raucous behavior in the Knesset, demanded answers from Sharon.

"I ask you, Mr. Defense Minister, who had the stupid idea to send the Phalangists into the refugee camps? Any village policeman could have predicted what would happen. Once you let them in, where was the supervision? Why didn't we know what was going on?"

Peres said that if Israeli officials knew about the massacre and did not move immediately to stop it, "this was a gross failure."

"I know you won't resign," he said to the Begin government, "but you should resign."

When Sharon rose to reply, a group of antiwar protesters in the spectators gallery took off their shirts to display T-shirts bearing the name of their organization, Peace Now, and were expelled by security personnel.

The demand for an independent board of national inquiry into the massacre was raised by Amnon Rubinstein, the leader of a small opposition party.

Quoting from this month's Israeli Army magazine, he said it was well known that the Phalangist militia was bent on destroying their longtime enemies, the Palestinians.

Begin, the last speaker, delivered a rambling, highly partisan speech that barely mentioned the central issue of a national board of inquiry. He accused Peres of attempting to exploit the massacre for political gain, adding, "You will not teach us morality."

"We stand before all and say we meant good and not bad," he said. "Even if the murderers are known to us, we still need a committee?"

[Signs of political maneuvering in response to the crisis appeared as a Begin coalition member, Liberal Party leader Dror Zeigerman, said in an interview with Reuter that he was considering forming an opposition Central Party with Rubenstein and former defense Minister Ezer Weizman.]

As the Knesset debate was going on, there were violent demonstrations and other protests in the West Bank and Gaza Strip and in Arab sections of Israel itself. There was also a general strike today in the occupied territories and in the Arab area of Galilee in northern Israel.

[In Nazareth, 64 people were reported injured, The Associated Press reported. At least 12 of the injured Arabs were shot.]