JAMES MICHAEL CURLEY, the fabled mayor of Boston for many years, said as they led him off to jail for some official transgression, "Out of evil comes good." That prospect may have been dubious in his case, but in the matter of the Keating Five, it could apply.

The Senate Ethics Committee's hearings into the efforts of five senators to ease the federal path of Charles Keating, owner of the since-failed Lincoln Savings and Loan Association, opened in an atmosphere of chagrin and embarrassment. Alan Cranston of California is also sick of other causes and did not show, but the other four senators milled about in the massive and windowless hearing room, wearing thin grins and chatting self-consciously with their clusters of lawyers -- each had three.

But several things were said during the opening day to indicate that at least some people in the room understood well the cure for such unhappy occasions.

The difficulty the senators faced was outlined with uncommon starkness by Ethics Committee chairman Howell Heflin (D-Ala.), whose oratorical output often has a large fat content.

" . . . Many of our fellow citizens," Heflin said, "apparently believe that your services were bought by Charles Keating, that you were bribed, that you sold your office, that you traded your honor and your good names for contributions and other benefits."

Heflin, a quintessential Senate insider, was certainly not saying he believed this was the case. But he was trying to reflect the public rage -- which only the Gulf crisis has deflected -- over the savings and loan debacle. The $1.3 million in campaign contributions the five received from Keating was small change in a league where billions were squandered by people resting on the cushion of federally guaranteed loans. But at least the hearings showed that Congress is doing something about S & Ls.

Another committee member, Sen. Terry Sanford (D-N.C.), came up with the remedy in his opening statement. It isn't just the Five who are paying for the politicians' dependence on big givers, he said; the whole Senate suffers.

"If the Ethics Committee finds that the raising of campaign funds in such large amounts does cast a shadow of suspicion on the institution, it is then the duty of the Senate to propose and enact such campaign-reform legislation, including, possibly, public financing . . . ."

The counsel for the Ethics Committee, the estimable Robert Bennett, of whom all members speak with unfeigned admiration, understands well the source of the infection. A shorter, stouter, more patient version of his younger brother, the imperious William Bennett, outgoing drug czar, he is built rather like a tank and has the same inexorable quality. He tends to flatten his adversaries with facts -- just the way Keating tried, with senatorial help, to flatten federal regulators who stood in his way.

"Paper is the most important witness here," Bennett said, pointing to several feet of documents detailing the two meetings the senators arranged to pressure the regulators into giving Keating what he wanted.

The senators who rendered this extraordinary constituent service are not entirely to blame, Bennett suggested, as he laid the groundwork for the sordid specifics of their exertions on Keating's behalf.

"The problem will come clear," he promised. "We have more and more constituents asking assistance of Congress; at the same time congressmen must ask more and more of those constituents for contributions."

The cost of the congressional election campaign in 1988 was $457 million, Bennett told the committee; the estimate for the election just concluded is more than half a billion. With the obscene amounts of money that have to be raised and spent, a Keating is almost essential. Keating was also generous with himself. One year, he set his S & L salary at $3.2 million.

Various schemes to reduce Congress's degrading dependence on contributors have been introduced. Chief among them is the campaign-finance reform bill, which passed the Senate last year but not the House. Another comes from Paul Taylor's new book about the 1988 campaign, "See How They Run." He proposes giving five minutes of free television time to presidential candidates on alternate nights and extending the largesse to congressional candidates.

For the moment, we are stuck with our panhandling senators, who bully bureaucrats for the benefit of their rich friends.

Says Common Cause president Fred Wertheimer, a leading advocate of reform: "To really understand what happened here, citizens have to ask themselves what would happen if they tried to get five senators to intervene for them in a government enforcement proceeding. The answer is it would never happen."

Mary McGrory is a Washington Post columnist.