SELDOM HAS a piece of proposed legislation been fought over so fiercely and so long as that which now takes the form of S. 1437, a bill to "codify, revise and reform" the federal criminal law. It was conceived 11 years ago and has gone through more months of hearings and more drafts and redrafts than anyone cares to count. Its present form is quite different from that it took just a year ago, when it was known, widely and notoriously, as S. 1. With just a little more tinkering, it will be ready for passage - and also ready to become the most remarkable achievement of this Congress.

Any wholesale revision of the criminal law that is sponsored by Sens. John McClellan (D-Ark.), Edward Kennedy (D-Mass.), Orrin Hatch (R-Utah) and Hubert Humphrey (D-Minn.) has got to be a compromise. And that is exactly what this is. It is not the bill that the Brown Commission proposed in 1970 and that civil libertarians prefer. Nor is it the draconian version that, the Nixon administration pushed so vigorously. During the last 12 months, Sen. Kennedy has worked a minor miracle by getting agreement to delete most of the worst features of S. 1 and to add to it some useful changes of his own.

What now exists is a monumental piece of work. It is the first codification of the federal criminal law in the nation's history. It removes archaic laws from the books, like that making it a crime to detain a government carrier pigeon. It makes some major changes in the law, perhaps most notably those concerning sentencing; this bill would create a mechanism for establishing guidelines for judges and for appellate review of sentences falling outside those guidelines. But most important, the bill creates a rational framework that eliminates the inconsistency and unfairness that now exist in a set of criminal laws passed, one by one, during almost 200 years.

Gone from the bill are the genuinely awful provisions of S. 1 that would have expanded the use of the death penalty, eliminated the insanity defense, broadened the reach of government wiretapping and created something akin to an official secrets act. But problems remain. Some of these are the residue of the Nixon administration's desire to increase substantially the government's authority to keep its activities secret. Others are the result of fairly recent judicial developments that have encouraged trial judges to restrict the exercise by individuals and news media of First Amendment rights. Most of these can be taken care of with a few simple flicks of a pen, and we hope the Senate will take another look at the arguments presented by the Reporters Committee for Freedom of the Press, which has been following this legislation closely.

These defects aside, there is one aspect of the bill that we urge the senators to reconsider. That is its failure to place real limits on the power of federal judges to punish those who break invalid or unconstitutional orders. As the law now stands, you will be punished for defying a judicial order even if a higher court determines the order was illegal. That is a strange and dangerous aspect of the law. It makes judicial orders more powerful than Acts of Congress and provides a tool that unscrupulous judges can use to crush constitutional rights. The justification for it has been the need to protect the sanctity of the judicial process, but some of the best federal judges will not defend it because of its lack of logic. If Congress passes a law you believe is unconstitutional, you can break it and take your chances; if you are found by the courts to have been right, you will not be punished. The same should be true of a judge's order. Congress could solve a host of problems, in the First Amendment area in particular, by simply eliminating the power of courts to punish people who violate orders subsequently found to have been invalid.

With those caveats - and we can't preclude the possibility that more defects may turn up in the bill's 300-plus pages as it moves through Congress - S. 1437 strikes us as a remarkably good bill.It would be better if it contained some other provisions, such as a more intelligent obscenity law, greater restrictions on wiretapping and an elimination of "use" immunity. But you never get all you want in compromise legislation, and Sen. Kennedy's work has put this bill into far more acceptable shape than we thought possible a year ago.