Athough the Maryland savings and loan bill is generally good legislation, it sets one unfortunate precedent. It blesses a peculiar deal in which the owner of a failed S&L -- Gerald S. Klein of Merritt Commercial Savings and Loan -- was able to negotiate his way out of most of the personal liabilities with which the failure left him. It is even conceivable that he will turn a profit out of the wreckage. The state has uneasily recognized this possibility by extracting an agreement that half of any profit is to be turned back to the state. But even that is pretty generous, when you count up the costs of Merritt's collapse to the state and to the depositors.

It's a sound rule that, when a financial institution fails, the owners' interest ought to be wiped out to the last dime before any public money is contributed to cover the remaining obligations. In the case of Merritt, that order of precedence was reversed. First the state's deposit insurance fund put $25 million into the settlement, and then Mr. Klein was allowed to work out a series of concessions from the Chase Manhattan Corp., which will buy the wreckage of Merritt and turn it into a Maryland branch of its bank.

It's hard to fault either the General Assembly or Gov. Harry Hughes for the choices they have made this autumn. It was urgent to get the bill passed, to get the failed S&Ls' liabilities off the state's books and to put the frozen deposits back into their owners' hands. So what went wrong?

The whole Merritt episode is further evidence that state governments should not be in the business of financial regulation at all. Unlike the federal government, a state does not have the financial resources to cope with bankruptcies on the scale that the Maryland S&L industry has seen this year. Also unlike the federal government, the state does not have the technical skill and experience to manage the consequences confidently.

For good reason the state was extremely anxious to have Chase promptly take over Merritt and its huge liabilities. That left the governor in a poor position to resist Chase's conditions. One of them was the $25 million payment in deposit insurance. Another was a free hand in dealing with Mr. Klein. Merritt's recordkeeping was fragmentary, and Chase, as it takes over this gigantic mess, wants to ensure Mr. Klein's cooperation in working out the accounts. The carrot it offers him is forgiveness of the millions of dollars of his personal debts to Merritt, while he retains valuable property and stays in other businesses. That makes perfect sense from Chase's point of view. But the state of Maryland, operating under duress, has had to give Mr. Klein much more gentle treatment than good public policy would otherwise have allowed.