In the temple of the Senate Environment and Public Works Committee, where dam-building is a religion and engineers the clergy, a band of heretics ran amok yesterday.

As expected, they were defeated on their proposal to change the way Congress distributes water project money. But first they had a little fun. They committed blasphemy.

Bad projects actually were called "turkey." Public works dams were described as "capers" and "pork." Congress was depicted as "a great barbecue" of political gourmands.

It was, in fact, a mourning virtually without precedent in the water resources subcommittee, a group of senators viciously pouncing upon a pending water resources bill that would authorize more than 100 new flood-control and navigation projects at a cost of billions of dollars.

The issue yesterday was an amendment by Sens. Pete V. Domenici (R-N.M.) and Daniel Patrick Moynihan (D-N.Y.) proposing a five-year demonstration scheme that would allot money to each state and allow it to build the water projects it wants.

This approach would abandon benefit-cost ratios ordinarily used to justify projects, remove Congress from site-and-project-selection and require the states to share minimally in construction costs. And traditionally public-works program would continue during the demonstration period.

They lost on a 4-to-3 vote, with subcommittee Chairman Mike Gravel (D-Alaska) casting two proxies against them, but the proposal stimulated a rare and enlightening discussion of federal water policy.

"This is the biggest idea to come before the committee since the beginning of the environmental legislation," Moynihan began modestly. "The Senate occasionally needs a big idea -- let's see if we can deal with it."

Moynihan said a basic problem with the present system is that the politics of the authorizing and appropriating committees govern the approval and funding of water projects.

The system, Moynihan noted without naming names, has meant that New York, without much clout on the key committees, gets little of the boodle. For example, of the $1.3 billion spent under a 1958 water-supply act, he said New York got "not one penny."

And, he continued, the imbalance has led to projects elsewhere the defy reason. One he cited is the Tennessee-Tombigbee Waterway, which called "a cloning of the Mississippi River" and which he said "will be an outrage when finally it is found out about." The $1 billion-plus canal, under construction in Alabama and Mississippi, will parallel the Mississippi River.

Sen. Alan K. Simpson (R-Wyo.) contritely talked about "turkeys," and confessed, "I'm backing one back in Wyoming," a water project inherited from a predecessor. "Something novel, new is required," he said.

"One of my great frustrations is to go to the chamber and scrap for fiscal sanity, then come back here and vote for projects that are unpronounceable and that are turkeys," he said.

Well, no more. Simpson said he knew howls of protest will come from home , but he will back no more projects that cannot be justified economically. "I'll be salting down the pork in the bottomless barrel from now on," he said.

Domenici said he will try to get his amendment passed in full committee later on. Co-religionist Moynihan sais he would help. Failing that, however, he wryly said he also would have an "extremely long" list of special New York projects he wants authorized.

Amen. And roll out the barrel.