The United States suffered an intelligence gap by not recognizing that the recent riots in Iran were going to get out of hand, according to U.S. officials.

Several members of Congress and the Joint Chiefs of Staff were more alarmed as they watched the initial demonstration in Iran than were the supposed experts in the State Department and the Intelligence community, administration officials conceded.

Intelligence officers interviewed admitted they did not underscore heavily enough the possible escalation of the initial rioting in Iran, but said the "customers" in Washington failed to demand indepth assessments.

Also, they said, the sharp curtailment of U.S. covert activities as part of the post-Watergate reforms of the Central Intelligence Agency, led to U.S. intelligence officials relying too heavily on the Iranian intelligence organization, SAVAK, for information.

One former CIA agent said it was standard practice before Watergate for U.S intelligence officers to pose as students and Iranian student leaders all over the world.

Although this penetration of Iranian student groups angered both the shah and State Department officials, this person said, it was, and is, the best way to forecast what young Iranian dissidents are likely to do.

One forum for early congressional concern was the Senate Foreign Relations Committee. Its members questioned two State Deparment executives - Jack C. Milkos and Henry Precht of the Bureau of Near Eastern and South Asian Affairs - in a closed session Sept. 15 on the demonstrations in Iran.

Robert R. Bowie, director of CIA's National Foreign Assessment, appeared before the committee in secret session Sept. 27 and, according to those who heard him, gave and optimistic view of the situation in Iran.

The Defense Intelligence Agency, as well as the CIA, failed to predict that the demonstrations against the shah would get out hand, officials said, even after the joint chiefs had expressed their concern to DIA.

Maj. Gen. Schlomo Gazit, director of Israeli's military intelligence operation, read the diplomatic traffic from Washington as well as his own intelligence reports on the situation in Iran as the trouble developed.

On the basis of comparing the U.S. and Israeli reports, Gazit said the United States was "several weeks" behind Israel in recognizing the gravity of the demonstrations and the threat posed to the shah.

If the United States had recognized sooner what was really happening in Iran, Gazit told a meeting of about 25 congressional staffers last Wednesday, Washington could have exercised more options, such as moving quickly to strengthen the shah's position.

Gazit's remarks were supposed to be for background, but the substance of what he said leaked out of the meeting and was confirmed by an Israeli who knew of his statements.

Interviews disclosed some bitterness about the State Department's pressuring the shah into reforms that, in the view of some administration officials, provoked the rioting.

Some officials singled out Lucy W. Benson, under secretary of state for security assistance, for making civil reforms a condition for Iranian arms sales - unwittingly fomenting rioting in the process in the view of her critics.

The public record shows that as late as Oct. 5 Benson viewed the rioting in Iran as a natural consequence of civil reforms.She told a House International Relations subcommittee that day there was nothing unusual about government having to put down rebellions, citing Shays Rebellion of 1787 as one the U.S. government was forced to quell.

Asked by Rep. Stephen J. Solarz (D-N.Y.), one subcommittee member who expressed alarm about the rioting, whether the United States would not have to be more careful in selling arms to the shah, Benson replied:

"I do not believe so, because we were adequately careful and cautious before."

Although administration leaders will demand better information about Iran in the future, several intelligence officials said they expect to be caught flat-footed again, partly because their operations in Iran are circumscribed by both the shah and the State Department.

However, some officials saw at least one shaft of light in the otherwise dark picture: the Carter administration may use the Iran intelligence breakdown as justification for breaking the alliance between U.S. and Iranian intelligence officials.

"We need to get independent input," said one U.S. official.

A CIA spokesman, when queried by The Washington Post, said the agency would have no comment on allegations that it failed to warn U.S. policymakers that the demonstrations in Iran were going to get out of hand.