Budget director David A. Stockman said yesterday that the administration will provide some form of credit aid for economically pressed farmers, because farm-state legislators have created "a kind of blackmail situation" involving President Reagan's proposed revision of the basic government farm programs.

Stockman told the Senate Budget Committee that the administration expects to receive long-term help on the farm programs -- its effort to cut price supports -- in exchange for a short-term "credit bailout" to tide over struggling farmers through this year's spring planting.

Stockman stirred a furor when he tried in vain last week to get Senate Republicans to agree to a formal "contract" trading credit assistance for support of Reagan's proposals to reshape basic farm programs. Yesterday he raised the stakes in a lecture to the committee on farm debt that created almost an air of confrontation between the administration and farmers, who in November were among the administration's staunchest supporters.

"For the life of me," he said, "I can't figure out why the taxpayers have the responsibility to go in and refinance bad debt willingly incurred by consenting adults who went out and bought farm land when prices were going up and thought they could get rich."

Stockman said he saw no difference between the plight of small businessmen, failed savings and loan associations, unemployed auto workers and economically pressed farmers. He said it would be one thing if farmers' problems had occurred because of pressure from "New York banks and other city slickers." Instead, he said, farmers and their lenders helped create today's debt problem.

He added, "We're probably going to have to do something because the drumbeat of political demands is so great that basically we're threatened with a kind of blackmail situation -- do something for us now to refinance all this bad debt or we're not going to allow the farm programs to be reformed. I think it's a sad day those kinds of threats are being made."

The administration's restructuring package, a revision of the program announced by Reagan six weeks before the November election, is to be unveiled today by Agriculture Secretary John R. Block.

As the Office of Management and Budget director was lecturing on Capitol Hill, the Independent Bankers Association of America -- representing most of the nation's rural banks -- was urging a broadening of the administration's debt-assistance program.

The bankers called on the administration to drop interest or principal "forgiveness" features of a farm loan-guarantee program and said that Congress should increase funding of the guarantees from $650 million to $3 billion. They also asked for a joint federal-private underwriting effort to cut interest rates on farm loans by 4 percent.

IBAA official Thomas H. Olson, a rural Nebraska banker, also said his group will support farm legislation that would provide for mandatory production controls as a way of boosting prices and getting farm production in line with demand -- a position diametrically opposed to the administration's.

The administration is expected to soon send Congress its 1985 farm proposal that would bar the use of mandatory production controls and gradually reduce federal farm-program spending by cutting price-support loan levels and direct subsidy payments.

Stockman, responding to questions from the Senate Budget Committee yesterday, said farmers must bear most of the responsibility for the debt crisis that many find themselves in today. Farmers recently have had a field day at the federal-subsidy trough, he added.

He described farmers as "the one group that has the least claim on the budget. The one group that had the greatest budget access in the last five years -- $60 billion in farm subsidies in the last five years -- starts the log rolling by demanding more. It's a little discouraging."

But Sen. Robert W. Kasten Jr. (R-Wis.), demanding to know the administration's timetable for announcing a debt-restructuring plan, said there is "a desperate need" for help in rural America and that it must be provided quickly.

Kasten complained that the United States had provided assistance for such entities as the International Monetary Fund and that it should do no less for U.S. farmers.

"I think we have our priorities wrong if we're bailing out the IMF and we're not willing to come through with any kind of rescue to small and medium-sized farms," he said.

Looking at Kasten, who represents thousands of dairy farmers, Stockman said, "Well, trusting we'll get some help when it comes time to bite the bullet on dairy-price supports . . . we get some help in getting wheat-price supports down [looking at grain-state Sen. J. James Exon (D-Neb.)] . . . we'll move forward on the credit bailout."