The Senate, in a major victory for local government lobbyists, voted yesterday to strip provisions limiting municipal regulation of cable television from legislation overhauling the nation's communications law.

The 59-to-34 vote ended three months of bitter controversy and intense lobbying between opponents of the cable provision, a coalition led by the National League of Cities and the U.S. Conference of Mayors, and the National Cable Television Association, the industry's leading lobbying arm.

In addition, it brought to a close a dispute between Sen. Barry Goldwater (R-Ariz.), chairman of the communications subcommittee, and Sen. Robert Packwood (R-Ore.) the chief sponsor of the cable measure as well as the overall communication legislation.

Goldwater had voted for the bill including the cable sections when the Commerce committee last July approved legislation by a 16-to-1 vote. He later said that he had not known the cable amendments had been included in the bill and accused the cable industry of being "sneaky peeky" in getting the language included in the bill.

"We do not know enough about cable television yet to write any legislation, especially any legislation that destroys a prerogative of the mayors and supervisors of this nation," Goldwater said yesterday.

The cable provisions of the bill received no attention at public hearings this year and were not added to drafts of the legislation until two days before committee approval. Packwood and Sen. Howard Cannon (D-Nev.) argued that the committee had held lengthy hearings on cable issues in 1977 and 1979, when Cannon was chairman of the Commerce Committee.

The bill would have lifted municipal authority to regulate basic cable television rates when other competitive media was available in cities. Another provision would have put a ceiling on franchise fees paid to states and cities by cable companies.

The action came as the Senate moved closer to likely final approval of the landmark telecommunications legislation, the first major rewrite of the Communications Act since the law was enacted in 1934.

The bill, versions of which have been considered by congressional committees since 1975, deregulates facets of the long-distance telephone and communications equipment market. In addition, it would revamp the authority of the Federal Communications Commission and free American Telephone & Telegraph Co. from the constraints of a 1956 consent decree the company signed with the government. The Bell System would for the first time be permitted to enter new markets, such as the data processing and home information fields.

But before voting on Goldwater's amendment, deleting the language from the bill, the Senate approved 52 to 40 an amendment sponsored by Packwood and Cannon that lifted the franchise fee section of the bill and restored some municipal authority over cable television.

Opponents of the cable measures and Goldwater refused to endorse the compromise. But the Senate, in an apparent demonstration of willingness to deregulate cable television at a later date, approved the Packwood-Cannon amendment before striking the sections entirely from the bill.

Thomas Wheeler, president of the National Cable Television Association, said he was disappointed with the vote on the Goldwater amendment but said the earlier vote was a "strong vote of confidence."

Wheeler said the defeat was "more a vote on process than on substance. We hope the case will be made expeditiously to confirm that judgement."

Leonard Simon, assistant executive director of the Conference of Mayors, praised Goldwater's "leadership and steadfast courage" in endorsing the municipal government position and said the action would be "greatly appreciated by mayors and cities across the country."