PRESIDENT CARTER'S health insurance plan is an ambitious and ingenious attempt to steer among all the familiar perils. Great numbers of Americans have long since agreed - at least in principle - that there ought to be a national system of health coverage. But the long procession of previous bills have alway failed. There have been two reasons for this.

One is that the genuinely comprehensive proposals, in which the insurance plan would pay all medical costs for everyone, have promised to be uncontrollably expensive. Experience with Medicare and Medicaid has demonstrated the extreme difficulty of holding down expenses in a system in which the patient never pays directly. The other is that the second favored approach - providing protection against only the most catastrophically expensive illnesses - would pour literally unlimited resources into the treatment of the most extreme cases. Inevitably, that would skew American medicine farther than ever from the routine care and prevention that, for the population as a whole, promises by far the greatest benefits in life expectancy and general good health.

Each of those alternatives currently has powerful support in Congress. Sen Edward M. Kennedy (D-Mass.) has been vigorously pushing the comprehensive plan, arguing - not persuasively - that costs can be adequately controlled when all payments are part of a unified national system. Sen. Russell B. Long (D-La.) has been advocating catastrophic protection - an immensely popular concept that, in the absence of any initiative from the White House, seemed very likely to pass this year.

It will astonish no one that President Carter's plan is a compromise. Like Sen. Long, the president would give complete coverage above a certain limit in major illnesses, no matter how prolonged. Like Sen. Kennedy, the president is anxious to broaden coverage, especially among the poor and that minority (about one out of five Americans) whose present medical insurance is either thin or nonexistent. In a major contribution to prevention, the president's bill would provide prenatal attention to all pregant women, and would cover the delivery and care of all infants.

The hearings and debates on this legislation are likely to take a year or more. The largest question will be the validity of the cost estimates and whether, this time, the limits are enforceable. Another question will be the balance among kinds of medical care - the kind that treats serious illnesses, and the kind that prevents them. Another will be the mechanism to limit physicians' fees in the subsidized programs for the elderly and poor.

To call the president's bill a compromise is hardly to disparage it. Only a compromise can now move the country, at last, in the direction of comprehensive health insurance. The limits are, necessarily, the practical ones of money and administrative capacity. But this is the direction in which the country needs to move.