This week's U.S. military confrontation with Libya accomplished the limited goal of demonstrating that President Reagan will deal firmly with Libyan leader Muammar Qaddafi, administration officials contended yesterday, but they expressed doubt about whether it will deter Qaddafi from sponsoring international terrorism.

"We accomplished what we set out to do," said one senior official familiar with the planning of the naval exercises in the Gulf of Sidra. "We've shown that we can operate there and we can sting 'em. But as for the impact on terrorist activities . . . . we'll have to sit back and watch."

A second official said the confrontation will show both Qaddafi and the Soviet Union that the United States will not be cowed by the Libyan leader's declaration of a "line of death" across the gulf. But the official said it was far from certain whether the larger complaint against Qaddafi -- that he has sponsored terrorists such as those who carried out the Rome and Vienna airport attacks in December -- has been resolved.

"He's been quite public in announcing a worldwide campaign of terrorist actions," this official said. "He's in effect declared a war of terrorism on us. Time will tell whether this sort of thing deters it."

Other officials said Qaddafi is so deeply committed to terrorist activity that it will continue regardless of this week's action. These officials suggested that the "best-case" scenario would be a "destabilization" of the Libyan leader over a longer period as a result of the conflict with the United States, but they conceded that in the past Qaddafi has rallied support at home in times of crisis.

Although described as strictly a naval exercise, officials said the U.S. action has a broader goal. "Certainly if the man would conduct himself within the norms of international behavior, he could run his country; but when he starts exporting terrorism and expanding and expanding, then that's when he needs to be put back in his box," presidential spokesman Larry Speakes said.

Another senior administration official said the naval exercise and military retaliation would also have a "salutary" effect on U.S. relations with the Soviet Union, showing them "there are certain things that we are not going to let happen."

This official, noting the presence in Tripoli of a Soviet Don-class submarine tender used as a command ship, and other Soviet ships nearby, said that "failure to react . . . would have had a very deleterious effect." The official, referring to Qaddafi, said "it is important to let him know we're not going to roll over and take this sort of crap."

A Middle East expert familiar with the planning of the administration's actions warned that the confrontation may encourage Qaddafi to launch more terrorist attacks. "This could serve as a pretext for violence by Qaddafi against Americans in the region, and also against Europeans, to divide allies from the United States," he said.

The specialist, who asked not to be identified, said the administration still needs "a counterterrorist policy that goes to the roots of terrorism. Otherwise, it's not very prudent to do something like this." He added that the operation "could backfire unless they have a plan for moving in the wake of this with the Egyptians and/or dissidents in Libya."

Former national security affairs adviser Robert C. McFarlane said at a news conference in New Orleans this week that "it has to be made clear that violations of American right of passage involve costs." He added, "The United States has made its point that you cannot threaten American lives and get away with it."