Defense Secretary Caspar W. Weinberger said last night that he doubted the continued presence of Marines sent to Lebanon Aug. 25 to oversee the evacuation of the Palestine Liberation Organization fighters from Beirut would have prevented the weekend massacre of unarmed Palestinians in refugee camps.

He noted that the 800 Marines were confined to the port area of Beirut and probably would not have been in position to stop or even know about a shooting rampage in the Shatila and Sabra refugee camps.

Those camps are 2 1/2 miles south, by road, from the former Marine positions at the Beirut port.

But this time, the Marines sent in by President Reagan to help keep peace will be deployed closer to the camps, administration officials said. Exact deployments of the American, French and Italian forces were still being planned last night.

Weinberger's answer to whether the continued presence of Marines in Beirut could have prevented the massacre was: "I don't think so; no." He said that was a "totally problematical" situation.

"They left because their mission was completed," said Weinberger. "They had finished the job."

Another senior official, who under rules of the administration briefing could not be identified, responded to the same question: "When you have a tragedy like we've seen, while you feel what was done was right, you have to ask yourself: 'Could anything more have been done?' "

Correspondents have reported from Beirut that the Israeli army allowed two groups of Christian militiamen to pass through their lines and enter the camps where an estimated 300 unarmed civilians were slaughtered in random shootings. The Israeli government has denied any responsibility for the slaughter.

Asked if he believed the massacre would have occurred if Israel had withdrawn its troops from Beirut at the same time as the multinational force left, Weinberger replied: "That's a pretty good question, but I'm not going to go into it."

The defense secretary did stress, however, that Israeli government officials "have told me on two occasions that they do want to get out" of Beirut. This may signal the administration's determination to keep the Marines on the ground at least as long as Israeli troops remain in Beirut.

"This is not a combat mission," Weinberger said. "They will not be patrolling the streets or anything like that." Their purpose, as was the case in the earlier mission is to provide a military presence while Lebanon establishes its new government.

The Marines are the 32nd Amphibious Unit, the same outfit that went in in August. They are attached to the 6th Fleet and spend much of their duty time afloat in the Mediterranean Sea. They had gone on leave after the first mission.

Asked if the Marines would arrive more heavily armed this time given the highly charged atmosphere created by the refugee camp massacres, Weinberger said he expected them to go in with about the same weaponry. Last time, the Marines took M16 rifles, antitank missiles and other light weaponry -- not the heavy armor needed to combat modern forces, such as the Israelis and Syrians deployed in Lebanon.

Assuming the Marines do fan out southward from the port area, as other administration officials predicted yesterday, the troops most likely would help Lebanese forces staff check points on routes to the heart of Beirut. Such a backup might have made a difference over the weekend when the militiamen went unimpeded to the refugee camps.