*William J. Casey, then the Director of Central Intelligence, is believed by many American Middle East specialists to have traveled to Baghdad in the early 1980's for secret meetings with his Iraqi counterpart, Saddam Hussein's half-brother Barzan. A former C.I.A. official said that Robert M. Gates, now the Director of Central Intelligence, who was then a senior aide to Mr. Casey, was in charge of preparing the intelligence data for the Iraqis. The C.I.A. did not return a call asking for comment. Secret Is Kept At Gates Hearings

During Senate Intelligence Committee hearings last October on Mr. Gates's nomination as C.I.A. chief, neither Mr. Gates nor any of the other C.I.A. witnesses let on that the U.S.-Iraq intelligence-sharing thought to have begun in December 1984 had actually begun more than two years earlier. Nor did any witness reveal that the Reagan Administration had permitted Iraq's allies in the Middle East to ship American-made arms to Baghdad.

At one point during Mr. Gates's testimony, Senator Bill Bradley, the New Jersey Democrat, asked whether the intelligence-sharing with Iraq had amounted to a "covert action" that under law should have been made known to the intelligence committees.

"I believed at the time," Mr. Gates responded, "that the activities were fully consistent with the understanding" of the law then in effect, "as it related to liaison relationships."

The 1975 law, an amendment to the Foreign Assistance Act of 1961, forbids the use of C.I.A. money for covert activities "unless and until the President finds that each such operation . . . is important to the national security of the U.S. and reports in a timely fashion" to the Senate and House Intelligence Committees.

One Reagan Administration official who spent dozens of hours testifying before the intelligence committees said he believed that the Iraqi program should have been presented to the committees, but was not because of a concern that the members of the committees who supported Israel would object. Approval for Policy 'At Highest Levels'

The decision to help Iraq was "not a C.I.A. rogue initiative," a former senior State Department official explained. The policy was researched at the State Department and "approved at the highest levels," he said. The idea, he added, was not to "hitch our wagon to Hussein."