THE EMERGENCY farm credit bill was not very good legislation, and yet President Reagan probably should not have vetoed it. True, the bill would only have extended more credit to farmers who can't carry their present debts, and it would have helped only a fraction of those now in trouble. It's hard to defend the bill with much enthusiasm. But this kind of legislation could have done one useful thing: It could have mitigated in some modest measure the wave of panic now rolling through the parts of the country that live by farming. It would have reduced the impact of an epidemic of farm failures on those regions where they are likely to be most concentrated. True, it would only have postponed the inevitable departure from farming for many of the farmers thatit was intended to rescue. But that would have been worth doing.

Farm panics, like the one that is currently gathering momentum, sometimes have effects that reach well beyond farming. Many kinds of unusual strain are developing in the American economy because of the high interest rates and the high exchange rate of the dollar. It would be wiser, for the present, not to aggravate them gratuitously. In his veto message, Mr. Reagan gave emphasis to the cost of the bill, and that's not a trivial matter. But under current circumstances it would have been justifiable to spend some money to deflect and diffuse the cycle of bankruptcies that seems to lie ahead.

But the congressional passage of the emergency bill and Mr. Reagan's veto are only preliminary maneuvering in preparation for a much larger issue. This year the basic farm legislation expires, and Congress is going to have to rewrite it. There's compelling reason to depart from tradition, although not necessarily in the precise direction that Mr. Reagan proposes.

American farm policy, as it now stands, tries to pursue two purposes that conflict with each other. It tries to stabilize farm prices, and it tries to raise farmers' incomes. To the extent that it succeeds in keeping farmers on their farms with rising incomes, it results in huge crops that fall heavily onto the price support system. By holding up prices -- particularly with a rising dollar -- it forfeits foreign markets for grain, and the surpluses pile up at the government's expense.

That's why the costs of price supports have soared under this administration -- which, unfortunately, has not been skillful in managing them. Mr. Reagan, anxious to get those costs down, is pressing Congress to make drastic changes in the country's basic farm legislation -- and Congress is resisting. The veto is only the beginning of this year's struggle over agriculture.