The House voted 340 to 83 yesterday to strengthen and extend the Clean Water Act after narrowly defeating an amendment that would have frozen fiscal 1986 funding for water-pollution control at the 1985 level.

The House measure would provide $21 billion over nine years. The Senate approved a similar, $18 billion version last month, putting Congress on track for the first major overhaul of the Clean Water Act since 1977. However, administration officials indicated that, because of the cost, President Reagan may veto any measure worked out in conference.

The act, passed in 1972 to control water pollution, provides funds to cities and counties to build sewage systems and treatment plants.

Both the Senate and the House measures, which have been endorsed by industry and environmental groups, would strengthen the law in several key respects, including providing the first federal effort to control "nonpoint source pollution," which results from runoff from farm land and city streets. Such contamination is thought to be responsible for half of all water pollution.

The House's 219-to-207 vote against holding fiscal 1986 spending at the 1985 level marked the first time this year that it has refused to impose a freeze on a fiscal 1986 spending measure.

Lawmakers, concerned about the federal budget deficit, have voted for freezes on seven other bills, including the huge 1986 defense authorization.

But yesterday's vote, lawmakers said, resulted as much from pork-barrel politics as it did from concern about water quality.

"Several members called me and said, 'Carl, if I support you, I'll lose my project,' " said Rep. Carl D. Pursell (R-Mich.), who sponsored the freeze amendment. "Public works are public works. There are a lot of projects in there the bill important to people."

During debate on the freeze amendment, which would have kept funding next year at $2.6 billion rather than raise it to $4.6 billion, leaders of the House Public Works and Transportation Committee charged that it would "gut" the program and could jeopardize the nation's health.

"If we cut this bill one more penny, you are destroying the pollution control of this country," said Rep. Robert A. Roe (D-N.J.), chairman of the Public Works subcommittee on water resources. "We are talking fundamentally about the health of the people of this country."

The bill provides $12 billion for direct waste-water construction grants and $9 billion in federal seed money for a new revolving-loan program. States would be required to set up funds to lend money for municipal sewage construction.

The measure also requires states -- or, if they refuse to act, the Environmental Protection Agency -- to develop plans to control toxic "hot spots," areas that do not meet water quality standards because of toxic pollution, even when the best available technology is utilized.

The nonpoint source pollution program would require states to identify waters that do not meet quality standards because of runoff from streets, agricultural areas and other sources that cannot be traced to a specific point of origin. The states would have to seek EPA approval of a four-year plan for controlling the pollution.

Both state actions would have to be completed within nine months of the bill's enactment.

States with approved nonpoint source pollution control plans would be eligible for grants to help implement them.

The House measure would increase civil and criminal penalties for those who violate the Clean Water Act, limit the ability of facilities to obtain waivers from national pollution standards and extend compliance deadlines for achievement of certain discharge standards.

The bill also directs EPA to set up an office to study the Chesapeake Bay.

Unlike the Senate bill, the House measure would not alter the formula for allocating federal sewage project construction money.