The Senate last night approved the second and final Panama Canal treaty by 68 to 32, giving President Carter an important victory at a troubled time in his 15-month-old administration.

The tensions and uncertainty of recent days proved unjustified as the 100 senators voted exactly as they did on March 16 when they approved the first Panama treaty.

At the end the Senate appeared fed up with the two-month debate, which in fact changed the minds of no more than one or two senators. A final hour of discussion was blocked last night because Sen. Russell B. Long (N-La.) said he and his colleagues had had enough.

"We've spent almost two months around here," Long said with feeling.

"It would be an insult to senators' intelligence to think any votes will be changed" by one more hour of debate, he added. Long objected to an attempt to delay a previously set 6 p.m. final vote, so there was no more debate.

During the day treaty supporters were nervous about three senators' votes. They were James Abourezk (D-S.D.), Howard W. Cannon (D-Nev.) and S. I. Hayakawa (R-Calif.). An hour before the final roll call, the leadership knew that all three would stick to the "aye" votes they cast for the first treaty, sealing their victory.

Carter has faced no rougher fight than the long battle over these treaties, and victory should give him a significant political lift. But the biggest benefit for him, at least in the view of many key senators, comes in the avoidance of the consequences of a defeat, which might have debilitated his administration.

In a statement after last night's vote, Carter said:

"This is a day of which Americans can always be proud. For now we have reminded ourselves and the world of the things that we stand for as a nation."

The president also announced that Panama's "maximum chief," Gen. Omar Torrijos, had agreed to accept the treaties with the changes made in them by the Senate.

Before finally approving the treaty yesterday, the Senate adopted several reservations, including one designed to reassure Panama that the United States has no desire to interfere with "its political independence or sovereign integrity."

This reservation was introduced by Majority leader Robert C. Byrd (D-W.Va.), Minority Leader Howard H. Baker Jr. (R-Tenn.); the floor manager of the treaties, Sen. Frank Church (D-Idaho), and Sen. Dennis DeConcini (D-Ariz.), a freshman senator who emerged as a key figure during the debate.

The purpose of this new reservation was to assert that the now-famous "DeConcini reservation" to the first canal treaty - asserting a U.S. right to intervene militarily in Panama to keep the canal open - did not mean the United States sought to interfere in Panama's internal affairs.

Reports from Panama have suggested that Gen. Torrijos may have some trouble selling the Senate's amendments to key segments of his tiny country's population.

Administration efforts to keep the votes in line for lastnight's final roll call became frenetic during the last two days. Several senators commented privately that the White House had had to engage in demeaning bargaining with at least one senator. Hayakawa.

Right after the vote last night, Hayakawa's office released a previously prepared statement saying Carter had offered to meet regularly with the senator to discuss important foreign policy and defense issues before he makes final decisions on them.

Last week Hayakawa threatened to reverse his vote on the Canal treaties because of his distress over the course of the Carter administration's foreign policy, which he said was too "weak."

To win over Sen. Cannon this time, the Senate leadership and the administration had to agree to a reservation he sponsored to the effect that "interest payments" to the United States on its original investment in Panama at the beginning of this century could continue to be made until 1999, if Congress so votes.

This could save the Treasury about $505 million, Cannon said. The protreaty leadership accepted this proposal, which could have the result of substantially increasing Panama Canal tolls in the future, apparently on the theory that the idea can be blocked by congressional action later.

Sen. Abourezk had threatened to vote 'no" on the treaty to protest the secret meeings of House and Senate conferees who are haggling over the degree to which natural gas prices should be deregulated. Abourezk, a strong foe of deregulation, has been outraged at what he calls secret sellouts by conferees and the administration to the gas industry.

Abourezk had the last words in the debate before the vote, and said he had assurances that the White House would now encourage " an open, democratic process" to resolve the natural gas issue. Sen. Alan Cranston (D-Calif.), majority whip, said he understood no firm promises has been made to the South Dakota Democrat, an outspoken individualist who has already announced his retirement from the Senate.

Abourezk did have a meeting just before the vote with Energy Secretary James R. Schlesinger.

Carter and Vice President Mondale were on the phone to numerous senators in the past two days. The staff on Carter's White House liason team to the Senate carefully - and, as it turned out, correctly -calculated where every senator stood.

The final outcome was considered a substantial accomplishment for Sen. Byrd by other senators and their staff. Byrd personally came out strongly for the treaties late last year, and although he was unable to shorten the lengthy debate, he did keep it under control throughout, and he conducted the crucial final negotiations with DeConcini that produced the "nonintervention" reservation.

Baker, too, emerged from the treaty debate with political benefits, though he also earned the ire of the far right in the Republican Party. Sen. Paul Laxalt (R-Nev.), the personally popular conservative who led the antitreaty forces in the debate, last night credited Baker with keeping Hayakawa's vote in the "yes" column through effective persuasion yesterday.

President Carter, in his remarks to reporters last night, indicated that he will accept Torrijos' invitation to travel to Panama for an official signing of the treaties. No date has been set for such a ceremony, but it is likely to be soon.

The canal treaty debate began in early February, and has occupied weeks of the Senate's time in a year that could easily have been filled with other legislative business. The Senate calendar will now be extraordinarily crowded for the rest of the year, and major bills may not be considered because of the time spent on Panama.

As Sen. Byrd has repeatedly pointed out, the only treaty that occupied more of the Senate's time was the Treaty of Versailles.

It has been the first Senate debate broadcast live on radio, by National Public Radio, a fact that has prolonged the discussions, according to many senators. Advocates and opponents of the treaties both seemed to feel that they had to repsond to every point made on the other side for the sake of the radio audience.

The audience on the Senate floor has almost always been tiny. There have regularly been no more than half a dozen senators present for long periods of debate.

Radio also carried the debate to panama, where the government provided a simultaneous translation into Spanish. Panamanians heard their country described by several treaty opponents as a denizen of communists, drug dealers and incompetents run by a "tinhorndictator" with communist sympathies or under the control of Havana and Moscow.

These characterizations may have contributed to the surge of anti-American sentiment that jounamlists and diplomats have described in reports from Panama in the last fortnight.

But the principal cause of Panamanian unrest, according to those reports, was the "DeConcini reservation" to the first canal treaty, asserting America's right to take unilateral military action to keep the canal open at all times. This addition to the treaty, overwhelmingly approved in the Senate, provoked numerous Panamanian political and business groups to urge Gen. Torrijos to reject the Senate's work and the treaties themselves.

Torrijos responded by writing ambiguous messages to the United Nations and certain foreign leaders raising the idea that the DeConcini reservation might be illegal or violate the U.N. or Organization of American States charters. This set off the only excitement of the debate on the second treaty.

The Carter administration and the Senate leadership began to look for a way to soothe the Panamanians without losing the support of Sen. DeConcini and his allies for the second treaty. The new "leadership reservation" adopted yesterday, reiterating U.S. support for the principal of nonintervention, was the result of that effort.

The treaties the Senate has approved can now be ratified by the U.S. and Panamanian governments at any time. Administration sources predicted yesterday that this could happend quickly.

There have been reports that President Carter might fly to Panama to exchange instruments of ratification with Gen. Torrijos.

But Panamanian opponents of Torrijos are expected to demand a new plebiscite to give Panama's voters a chance to accept or reject the changes the Senate made in the treaties since they were approved in Panama last year. Torrijos, according to reports from Panama, will try to raticy the treaties without a new plebiscite if he feels he is strong enough politically to do so.

The exchange of formal instruments of ratification will not actually put the new treaties into force, however.

An amendment to the treaty approved yesterday stipulates that ratification cannot formlly occur until six months after Congress passes implementing legislation or by next March 31 at the latest.

Ideally, the administration wants the House and Senate to enact implementing legislation creating a new Panama Canal Commission and other entities needed to transfer the canal according to the treaty's provisions before the treaties go into effect.

Treaty opponents in the House have threatened to block this implementing legislation as a protest against the treaties. But administration officials believe that they can actually implement the pacts by executive action if Congress refuses to pass the legislation, although officials acknowledge that this sort of nilateral action could provoke a crisis.

Under the Panama Canal Treaty approved yesterday, management of the canal will be transferred to a joint Panamanian-American commission on which the United States will retain a dominant voice. Operation of the canal will be slowly but steadily turned over to Panama, and at noon on Dec. 31, 1999, the canal will pass fully into Panamanian hands.

The treaty also envisages cash payments to Panama of $.30 a ton on all freight passing through the canal, plus a fixed payment of $10 million a year, plus a second $10 million if toll revenues generate that much money.

The "neutrality treaty" approved by the Senate last month will remain in force permanently. It commits Panama to maintaing the neutrality and accessibility of the canal for all users. Amendments added by the Senate state explicitly that the United States has a right to defend that neutrality with military force, and that U.S. warships will be able to move expeditiously through the canal in an emergency.

The long debate on the two treaties was repetitive and rarely emotional. Treaty opponents argued both against the pacts themselves, and against a gesture they charged was a symbol of national weakness - the decision to relinquish American control over the canal.

One subject that many senators said privately was a concern to them but which did not receive much direct attention in the debate was the potential effect in Panama and elsewhere in Latin America of a Senate vote to reject the treaties.

Sen. Russell B. Long (D-La.), one of the Senate's most influential members, said in a recent interview: