The United States and Spain yesterday formally unveiled the new agreement to withdraw 72 U.S. F16 fighter-bombers from Spain within three years, while Defense Department officials expressed pessimism that another European base can be found for the warplanes.

The U.S. officials, who asked not to be named, said they are deeply concerned that the Spanish success in ousting the 401st Tactical Fighter Wing after protracted negotiations with the Reagan administration could embolden other countries of NATO's southern flank, notably Greece, to make similar demands.

Meanwhile, in a joint statement issued simultaneously in Washington and Madrid, the two governments said that while the planes will be withdrawn within three years of signing the agreeement, it also provides for continued U.S. use of "operational and support installations in Spain and. . . use of Spanish territory, territorial sea and airspace. . . . "

In addition, it said other agreements "shall also be concluded for crisis and wartime use" of Spanish military facilities by the United States "in support of NATO reinforcement plans."

The new accord will be three years longer than the old one, lasting at least eight years with a provision for one-year extensions. It is expected to be signed by May 14 when the 1982 U.S.-Spanish agreement on friendship, defense and cooperation expires.

While administration spokesmen said the issue of where the F16s will be based, and who will pay the cost of relocation, will have to be discussed in the NATO alliance, U.S. defense officials said the single-engine Fighting Falcon jets may eventually be returned to the United States, withdrawn from the active Air Force and assigned to reserve units as part of an economy drive in the face of deep new defense budget cuts.

The United States must negotiate the future status of such major military installations as the huge U.S. Navy base at Subic Bay, the Philippines; military intelligence listening posts in Turkey that eavesdrop across the Black Sea on Soviet space and military activities, and the sprawling U.S. base in the Azores, Portugal.

"Everybody's watching the other talks, particularly Spain," said a State Department official. "These guys all look at what the other guy gets." He called it "comparison shopping" and said the Philippine goverment has set up a "study group" to examine other U.S. base negotiations.

Sen. Jim Sasser (D-Tenn.), chairman of the Senate subcommittee on military construction, warned that the accord with Spain could "embolden" Turkey, Greece and Portugal to make similar demands for withdrawal of U.S. military forces.

In a letter to Defense Secretary Frank C. Carlucci, Sasser called it "a major mistake" that "could severely weaken deterrence in southern Europe."

But State Department spokesman Charles E. Redman said the new agreement would strengthen the U.S.-Spanish defense relationship, which had become clouded by the Spanish demand that the F16s, the main NATO backup unit for its vulnerable southern flank, be removed from the base at Torrejon eight miles from Madrid.

"It points toward a new defense agreement that will have important positive elements for the United States and Spain and for allied defense and security," he said.

Washington Post special correspondent Tom Burns reported from Madrid that a senior Spanish diplomat said that with the issue resolved, "we are prepared to be very flexible about all other aspects of defense cooperation." He said Spain had not sought to expel the United States but was "looking for a new agreement that would keep them here."

The accord announced yesterday solved a major political problem for Spanish Prime Minister Felipe Gonzalez, who had made an election pledge to seek removal of the 401st and reduction of the U.S. military presence.

Some U.S. officials and members of Congress are worried that Greek Prime Minister Andreas Papandreou, whose government began negotiations on the fate of U.S. bases in Greece last November, will make similar demands.

Removal of the wing over the next three years will reduce the number of U.S. military personnel in Spain by 3,800, leaving 5,200 others plus their dependents, according to Pentagon officials.

The other major U.S. facilities in Spain include a naval base at Rota, a pilot gunnery range and a base for five air-to-air tanker refueling planes at Zaragoza and various communications sites around the country.

But Redman did not hide U.S. disappointment over the withdrawal of the wing, calling it "the one substantial exception" to an otherwise positive agreement.