Agriculture Secretary Bob Bergland, who has taken a firm stand against major concessions to demonstrating farmers, lashed out yesterday, saying that some members of the American Agriculture Movement are "driven by just old-fashioned greed."

The secretary's attack, made on ABC's Good Morning America, was balanced by an assertion that some farmers "are in real trouble," but the remarks added to the already combative mood of many of the farmers in town.

Bergland was booed by farmers later in the day when he appeared before the House Foreign Affairs Committee. But in a session with reporters after the hearing, Bergland stood by his description of some farmers as "driven by greed."

"Make him secretary of agriculture in China," heckled one farmer who had sat through Bergland's testimony concerning the outlook for the growth of U.S. farm exports to China.

In his televised remarks earlier in the day, Bergland characterized visiting farmers and their problems this way:

"Those who are farming... from west Texas north are in real trouble -- that's true -- because of a high and rising cost of irrigation and the depleting water reserves. There are others who have made bad business judgments. They've paid too much money for land. I know some people in that category. Others are seeking publicity and others are driven by just old-fashioned greed."

When the broadcast ended, Bergland turned to the television crew in the studio and said, "We'll get calls on this one, won't we?"

As the secretary moved from the studio to an adjoining room he continued to complain about the demonstrators.

One person present said he heard Bergland describe Tommy Kersey, a leader of the AAM from Henderson, Ga., as "a pure right-wing southern redneck who is not hurting," financially.

Reached later, Bergland denied having made the statement.

"I didn't say that," he said.

During last year's AAM demonstrations here, Bergland frequently was heckled or harassed by farmers. In Amarillo, Tex., demonstrators threw eggs at him.

Bergland was criticized by some farmers yesterday for refusing to meet with AAM representatives this week.Aides responded that Bergland met recently with leaders of last year's AAM protests.

Gerald McCathern, national wagonmaster for the AAM, said on WJLATV last night that Bergland's statements were "regrettable" and "unmitigated lies." He said it appeared that Bergland was trying to provoke farmers into breaking out of their barricaded area on the Mall.

A scheduled 10 a.m. meeting between Deputy Assistant Secretary of Agriculture David Unger and AAM representatives was canceled after no farmers showed up.

So far, the protests have shown no sign of moving Bergland or many members of Congress. Bergland said on his ABC-TV appearance yesterday that many of the farm troubles are localized and don't justify new federal programs.

He mentioned in particular the rising costs of irrigation for farmers in west Texas, Oklahoma, Kansas, Nebraska and Colorado.

Bergland told the House Foreign Affairs Committee that the steep increase in grain support prices would "turn the cattle industry inside out, and they're just getting on their feet."

Sources also released a Congressional Budget Office preliminary study showing that the increased supports sought by AAM would add $10.7 billion to government farm costs by 1980 and would cut wheat exports by half by 1981 by raising U.S. prices above world levels.