If the Senate debate on the Panama Canal treaties had to sell tickets to stay in business, it would have closed weeks ago.

Sen. Patrick Leahy (D-Vt.) says the proceedings "resemble the plot line of a television soap opera. You could listen to the debate for several days, leave for a week or two, and come back to it having missed very little. All the arguments are being forwarded again and again."

As a literal description, Leahy's is impossible to fault. But, in fact, the arguments that have been repeated again and again for almost two months do not cover many of the strongest senatorial emotions that appear to be covertly at work in the debate - judging from private conversations with senators.

Off the Senator floor, numerous senators acknowledge that the formal debate has often been a symbolic substitute for deeper issues that have rarely been addressed directly: the true lessons of the Vietnam War and the proper world role for the United States in the post-Vietnam era.

Sen. Robert C. Byrd, the majority leader, alluded to all that on the second day of the debate, nearly two months ago. Byrd spoke of those who feel that "we are sliding down the mountain of greatness, that the Vietnam War - and now the possibility of what some of the opponents refer to as 'giving up' the Panama Canal - are signs that our national fiber is being peeled away, that we are soft."

As usual, Byrd had a good sense of what was behind many senators' postions on the canal treaties. The hard core of opposition (20 to 25 senators) is obviously convinced that there are bad treaties, not in the best interest of the United States. But many of them are even more upset about the symbolism of giving up the canal.

For example, Sen. Orrin Hatch (R-Utah), a freshman member of the "new right" bloc in the Senate, said the other day - not in debate but in the Senate cloakroom - that "this is the culmination of that pattern of surrender and appeasement that has cost us so much all over the world."

Hatch, Sen. Jesse Helms (R.N.C.), Sen. James B. Allen (D-Ala.) and others in the hard core of opposition share a deeply pessimistic view about the course of U.S. policy and even the fate of the republic in the hands of its present leaders. That pressimism has an emotional flavor - it comes from more than political analysis. "Is America really going the way of Rome?" Hatch asks.

That pessimism sets the opponents apart from a large majority of their Senate colleagues. But the diehards are numerous enough to work coherently to prolong the debate.

They also have support in the treaty votes for senators who do not share their world view, though exactly how many is hard to say. Sen. Charles Percy (R-Ill.) has told colleagues that he reckons a secret ballot would result in 85 affirmative votes. (The first treaty got 68.) Other Senators privately put the number at 75 to 80. But even some of the opponents acknowledge that they have "political" votes on their side from senators who are nervous about reeleciton or who want to position themselves on "the right" in this fight.

Byrd has said publicily that three senators who voted against the first treaty had promised to vote for them had they been needed for two-thirds approval.

Publicily the opponents' protracted opposition to the treaties has been accepted with good manners by the majority and the the Senate leadership. But privately their tactics - and the time they are consuming in a busy legislative year - have angered many senators. Some are furious at the amount of time being "wasted" - a word used by Sen. George McGovern (D-S.D.).

The anger has emerged vividly just once, in an impromptu exclamation of frustration from Sen. Daniel Patrick Moynihan (D-N.Y.). Moynihan was ignited by an amendment offered by Sen. Malcolm Wallop (R-Wyo.), another of the "new right" senators.

Wallop's amendment said, in effect, that if Panama failed to live up to the terms of the new treaties, then the existing treaties of 1903 and 1936, giving the U.S. virtually unlimited rights in the Canal Zone, would come back into force. That contradicted the first article of one of the new treaties, which explicitly declares that their adoption nullifies the 1903 and 1936 treaties.

The amendment was tabled, 50 to 37, and Moynihan rose soon after the vote. He noted that the Senate was then in its sixth week of the Panama debate:

"By comparison the North Atlantic Treaty occupied 12 days of the Senate's time. And we begin to enter into a period where standards are collapsing. The senator from Wyoming [Wallop] this afternoon . . . submitted an amendment to this treaty which was so inane, so devoid of intellectual competence or even rhetorical merit, as literally to silence the supporters of these treaties."

Moynihan was enraged by Wallop's attempt to ignore the first article of the treaty. "Now we are all at least supposed to have learned to read before we come into this chamber," he said.

"Are we to reduce this United States Senate to a playground, a playpen of juvenalia? . . . Are we going to ask the world to look down upon us as persons who have no standards of the integrity of an argument, of the logic of a sentence, of the empirical basis of an assertion of fact? . . . there is the reputation of the Senate involved . . ."

Moynihan is a newcomer to the Senate, and his impatience is not shared by many of his senior colleagues. (Moynihan himself realized he had broken the rules, and his diatribe was much toned down for publication in the Congressional Record, which is less a record of what is said in Congress that of what members wish they had said.)

Wallop and his colleagues on the opposition side are not intimidated by remarks like Moynihan's.They realize that President Carter and the Senate's treaty backers failed to sell the treaties in the country as an unassailably good idea for the United States. So they have a license fo assail the treaties - which happen to be the handiest available symbol of the "weakeness" they depolre in American policy.

The length and repetitiveness of the debate are a measure of the proponents' failure to win over public opinion decisively. The issue of America's post-Vietnam world role is still an open one, at least in the U.S. Senate, and that gives the debate its importance, and even its legitimacy - boring and irrelevant as the discussion sometimes is.