Surrealism outdoes itself when the head of the country's secret intelligence service moves around town followed by troops of photographers. But that's only the most obvious incongruity in the bizarre affair centering around the director of the Central Intelligence Agency, William Casey.

All the persons in the drama seem to be playing roles cast for other actors.

The ultimate irony is that Barry Goldwater, a conservative Republican and longtime friend of the CIA, had to be saved from leading an inquiry that would have done serious damage to the agency.

Goldwater became head of the Select Intelligence Committee when the Republicans took over the Senate. He wanted as director of the agency Bobbie Ray Inman, an admiral with a long and honorable background in intelligence work. Goldwater did not favor Casey, the Wall Street lawyer and Reagan campaign director whom the president tapped for the CIA post. But Casey made Inman his deputy, and Goldwater confined his displeasure to private grumbling.

The private grumbling became public outrage after Max Hugel, another Reagan campaign worker and Wall Street figure whom Casey appointed to head covert operations for the CIA, resigned following charges of improper stock transactions. Casey apparently brushed off Goldwater's questions about Hugel in rude fashion. Goldwater then seized on the Hugel affair, and on several long-standing transactions involving Casey's finances, to demand that he resign as CIA director.

Democratic senators, led by Pat Moynihan of New York, insisted that before any rush to judgment on Casey there be a serious inquiry. A couple of senior Republican senators friendly to Goldwater apparently thought there was another big scandal brewing. To head that off, Assistant Majority Leader Theodore Stevens of Alaska and William Roth of Delaware called on Casey to resign in order to avoid doing damage to the CIA by a long inquiry.

By the end of last week, the stage seemed set for a full-dress inquest, and Washington was alive with dirty rumors. One story, leaked from the House Intelligence Committee and subsequently denied, had it that the real bone of contention was a plan approved by Casey for a coup in Libya that featured assassination of the strong man of that country, Muammar Qaddafi. Another story claimed that the old boy network in the CIA, led by Adm. Inman, wanted to get Casey. Another rumor alleged that somebody in the White House wanted Casey out.

Against that spreading cloud of suspicion, the White House and Senate Majority Leader Howard Baker mobilized a counter campaign on behalf of Casey. The White House announced that Casey had the personal backing of President Reagan. It spread word that even if Casey was forced to resign, the job would not go to Goldwater's favorite, Adm. Inman. It even surfaced as possible successors to Casey the names of three retired generals -- Vernon Walters, Daniel Graham and Sam Wilson -- manifestly inferior to Inman in qualifications.

Paul Laxalt, the president's best friend in the Senate, charged that Casey was being tried in public on "unsupported allegations." Former Treasury secretaries George Schultz and William Simon joined with some veterans of World War II intelligence operations to support the CIA director. Casey defended himself in a 45-minute appearance before CIA employees. Adm. Inman went on television and strongly intimated the charges against his boss were rooted in Democratic political objectives.

The key move was the designation of a committee counsel to lead the inquiry under Goldwater. The man chosen was Fred Thompson, a Tennessee associate of Majority Leader Baker, and an old friend of the White House counsel, Fred Fielding. "If I were guilty, I'd sure want to be investigated by Thompson," a Republican lawyer in Washington, who worked with him during the Watergate hearings, said of the appointment. Thompson took over a quick survey of papers delivered to the committee by Casey. Yesterday, after two days of closed hearings, Goldwater and Moynihan issued a statement saying that Casey had not been found unfit for his position. But Casey has acknowledged the appointment of Hugel was a mistake, and there is contention within the committee about how big a mistake.

All signs are that Casey will get off -- at least for the present. The Democrats feel the Republicans will face a political problem any time any suspicion of any kind ever falls on Casey. And there lies the lesson of the whole, strange affair. It is that suspicion of the CIA, and similar agencies, now runs so heavy in the country that it takes serious effort of an organized kind to prevent a clash of personalities and a whiff of wrongdoing from spreading into a major scandal.