Standing ramrod straight and smiling before the nation's major newspaper publishers, Adm. Bobby Ray Inman, the number two man at the Central Intelligence Agency, today said he had resigned his key post because he had been through several bureaucratic hassles too many.

Inman, in his first extended public explanation of his resignation, said he could not expect to be appointed CIA director. He believed he had given his country 30 years of good service, and "I have lost any zest that I had for the bureaucratic problems," Inman said.

Praised by members of Congress and other intelligence experts as perhaps the best in his business, Inman, who is deputy director of the CIA, denied that he had quit because of any personal or policy disagreements with CIA Director William J. Casey.

"He's been an amazingly patient man with a deputy who tends to be very direct and very outspoken in public and private," Inman said.

"It has been an enormously exciting life as it has gone along," said the the admiral, widely acknowledged as a wizard of electronic spying. "But the nature of those things is that there is a limit in how far you can go."

The assembled members of the American Newspaper Publishers Association, although on record as disagreeing with Inman's efforts to cut off public access to CIA information, later rushed to congratulate him on his speech--an absorbing account of how a strange mix of global optimism, preoccupation with Vietnam and budget constraints left U.S. intelligence gatherers unable to anticipate crises like Iran.

The publishers were visibly edgy Monday when Jeane J. Kirkpatrick, U.S. ambassador to the United Nations, stretched her scheduled 20-minute talk on the intricacies of Third World politics to 45 minutes. Associated Press President Keith Fuller suggested after she left that her performance offered a clue to the general ineffectiveness of the United Nations.

But Inman got a very different response as he defended U.S. technological spying--"I reject out of hand that we could be surprised by a Pearl Harbor attack of any major kind"--and lamented the failure to have enough information and competing analysts to anticipate upheavals in the Third World.

"What is the state of the national intelligence apparatus today?" he asked. "In my view, for the problems that we're going to face in the 1980s and 1990s, I would tell you it's marginal."

Several publishers in the audience said they considered the most significant sign of Inman's distress to be his answer to Cleveland Plain Dealer publisher Thomas Vail. Vail asked the four-star admiral--the first naval intelligence officer ever to reach such a rank--what he considered the most effective intelligence organization in the world.

"Let me duck that," Inman responded.

When Tom Johnson, publisher of the Los Angeles Times, asked why he had decided to resign, Inman produced a much longer answer, which he appeared to have been thinking about for some time: "In 1980 it was my sense that that was really the time to start a second career . . .when you become an intelligence specialist, normally the highest you can aspire to is perhaps two stars . . . by a great fluke, a little more than that has come my way."

"But it is very clear in a structure in which presidents select their intelligence officers, as they properly should, they want that chief intelligence officer to be someone they know and understand."

Inman said he would have left in 1980 but "my arm was twisted severely" to help organize a rebuilding of American intelligence capabilities, a process that Inman told the publishers he thought was now well under way.

"I'd been complaining for the last four years that we weren't getting on with trying to shape a long-range program to rebuild the U.S. intelligence system, and it was a little hard to back away from the offer to at least start to shape that," he said. But, he added, "It seems that now is the right time to get off the train."

Inman got a sustained laugh from his audience in the Fairmont Hotel with his confession that he had lost enthusiasm for the bureaucratic wars.

"I would like all of you to assure me," he told the publishers, "that I am not going to find those bureaucratic problems in the private sector."