The Senate last night moved toward a three-year extension of the Engangered Species Act after handily defeating several major attacks on the law.

A final vote is expected today on a measure that has emerged as one of the most controversial environmental laws of the decade.

The intensity of yesterday's debate, often reaching high decibel levels on the floor, was felt in the public gallery as well.

Ushers ejected a spectator who shouted an admonition at Sen. William Scott (R. Va.) as he spoke in support of an amendment that would have limited coverage of the act only to species identified as beneficial to mankind. The unidentified spectator blurted out that such a determination would be impossible to make.

After order was restored, the Senate agreed. Scott's amendment was defeated, 87 to 2.

Earlier, in the key vote of the day, the Senate rejected an amendment by John Stennis (D-Miss.) that could have exempted dozens of federal public works projects from coverage. The vote was 76 to 22.

Stennis, in an unusually impassioned call for support, argued that the law, if extended, would cost jobs, stop public works projects and deter "progress".

Unmentioned in the debate was the future of a major project in Mississippi, the Tennessee-Tom bigbee Waterway.

Environmentalists and railroad interests have criticized the $2 billion-plus barge canal on economic grounds. But it is widely believed that the project could be challenged on the ground that it endangers a half dozen or more imperiled natural species covered by the law.

Stennis proposed to grandfather the law, which will expire Sept.30, in twoways. He would have exempted from coverage any project 50 percent complete or any project under contract or for which construction money had been appropriated when the legislation was passed in 1973.

His proposal also would have left it to the agency building a project - rather than the Department of Interior - to determine if completion should take precedence over an endangered plant or animal.

John Culver (D-Iowa), floor manager of the bill, said the Stennis amendment could apply to at least 650 federal public works projects that were under way or contracted for when the law was passed.

"The Stennis amendment would destroy the original intent and purpose of the act," Culver said.

Stennis and his allies - which included the U.S. Chamber of Commerce and the forestry industry - contended the changes were neccessary because of inflexibility in the law. They cited the Tennesse Valley Authority's $116 million Tellico Dam project, which was stopped just short of completion after the courts found TVA had not adequately protected the endangered snail darter fish.

The Supreme Court held last month that TVA had not fulfilled its legal obligation to protect the darter, whose habitat would have been destroyed had TVA filled the Tellico Lake.

But Culver, Gaylord Nelson (D-Wis.) and others argued throughout the long and often emotional Senate debate that the Tellico project was the only one out of hundreds in which an accomodation had not been reached and which had finally been stopped because of non-compliance.

As proposed by the Environment and Puiblic Works Committee, the law would be extended for three years with one major change - creation of a seven-member Cabinet-level committee that could override protective clauses of the act when unresolvable conflicts arose between a project and an endangered species.

That change, known as the Culver-Baker amendment after Culver and Howard H. Baker (R-Tenn), was opposed by the Carter administration but supported by a coalition of major environmental groups as an acceptable "fallback" position to prevent a more serious assault on the law.

Nelson proposed but then withdrew an amendment that would have simply extended the law for three more years.

During a bitter exchange with Culver over allocation of debate time, Nelson charged that there had been a "panic in Congress and elsewhere . . . among industrial developers and politicians" who saw a "great threat to progress" from the law. Nelson said their fears "are not founded in fact at all."

"The argument I am making here," Nelson said, "is that all the emotional upset because of Tellico and the snail darter is not justified by the facts . . . The law has worked well and Tellico is not a good case - it never should have been completed."

Baker, however, said that if "common sense" is not written into the law pressures would be such that "the act itself would expire."

Companion legislation to extend the act is pending before the House, but the leadership does not expect to call it to vote until after mid-August at the earliest.