THE REAGAN administration's first agreement with Cuba rectifies some part of the wrong Fidel Castro did when he cynically slipped several thousand criminals and mental patients in among the 125,000 refugees he let sail from Mariel, without American visas, in 1980. These "excludables" as they are known under American immigration law, are now to be processed for return to Havana. Under the new agreement, they do not lose their claim to rights allowing them to plead to stay in this country. But if their plea is denied, back they will go. Cuba has undertaken to receive them, should they be found finally excludable.

It is darkly amusing to hear Mr. Castro declare now that he did not intentionally insert these misfits into the Mariel boatlift. Nothing in the record supports his statement. In the intervening years, he played on what he understood full well to be the American distaste for his little trick, at times refusing to discuss the excludables' return unless Washington also discussed the resumption of trade and diplomatic ties. Two presidents, however, insisted that the issue of the excludables be kept in a context of immigration only. Once Mr. Castro decided that Washington would not be blackmailed, the talks moved on.

Jimmy Carter reacted to Havana's dumping of the excludables, as he had to, by halting regular immigration from Cuba. The flow is now to be resumed under a quota of 20,000 a year. Some 3,000 political prisoners are stacked up waiting to come to this country; they have, and should have, priority. Many close relatives of earlier Cuban emigrants are stacked up too; the law provides for many of them to come in over the quota.

There is, however, a special problem. The Mariel boatlift brought to American shores in barely a week the equivalent of six years' quotas. These immigrants are about to end the usual five- year transition period and to start becoming eligible to bring in their close relatives too. So an extraordinarily large number of Cubans may soon be headed for the United States; more precisely, for Florida and for Miami, already a 60 percent Cuban city. There are substantial costs for the absorption of such large numbers of immigrants in one area, and the federal responsibility to share them must be affirmed.

The making of an agreement such as this one cannot fail to raise the question of whether it could lead by stages to an overall improvement in U.S.- Cuban relations. Don't hold your breath. The United States tried hard to improve bilateral relations in the 1970s; Fidel Castro responded with a splurge of new involvements in Africa and Central America. It is enough that this agreement simply undoes the damage done to immigration, by Cuba unilaterally, in 1980. The Cubans apparently decided that they had squeezed the Marielito issue dry and that it would serve the regime to reopen the emigration safety valve. No change is evident in the attitudes and policies that have kept the two countries at odds for 25 years.