It has been an extraordinary year marked by defections, arrests and expulsions around the world, with spies of virtually every nationality caught in the snares of friendly and hostile foreign governments, and the United States has been in the thick of the action.

A telephone call last May from a disgruntled ex-wife to the FBI unveiled a decade-old spy ring managed by Navy communications specialist John Anthony Walker Jr. and riveted national attention on international espionage.

Since then, it seems, the problem has only gotten worse, with two more Americans arrested last week on espionage charges.

Experts say the rash of spy cases stems partly from the U.S. intelligence community's increased emphasis on security.

But they say the cases also represent not only a coincidence of random events but also a conspicuous failure of the system to detect earlier persons willing to sell national secrets at a cost of millions of dollars and, perhaps, human lives.

Roy Godson, an intelligence expert and professor of government at Georgetown University, said yesterday that based on published accounts of the cases this year, "It appears there has been very great damage to our national security costing the American taxpayers hundreds of millions of dollars to repair and possibly having led to the loss of life and damaging the reputation of American intelligence by making it more difficult to recruit and run agents in the future."

Godson said he favors requiring U.S. foreign service and intelligence officials who have access to sensitive information to "inform" the Central Intelligence Agency or the State Department security office each time they go abroad or have contact with foreign officials whose intelligence services are considered hostile to U.S. interests.

But there is a flip side to the revelations of espionage in this country.

"We're getting better at catching spies and people are taking it seriously," said Sen. Patrick J. Leahy (D-Vt.), vice chairman of the Senate Select Committee on Intelligence.

But Leahy said that a number of changes pending in Congress and resisted by the Reagan administration could help prevent future intelligence losses.

Leahy made his comments in the wake of the latest espionage arrests, one of a longtime CIA analyst accused of selling information to China and one of a Naval Investigative Service analyst accused of selling classified information to a foreign country, which sources say is believed to be Israel.

In the past, Leahy said, the CIA and FBI have been "weakened . . . because they wouldn't cooperate" in espionage cases. "One thing good that has come out of this rash of spy cases," he said, "is that the CIA and FBI are cooperating extremely well."

Leahy and Sen. William S. Cohen (R-Maine) have written legislation that would reduce the number of foreign intelligence agents in the United States from Soviet bloc countries.

Leahy said yesterday that passage of that legislation would further improve the ability of the FBI and the CIA to detect and monitor foreign intelligence operatives in this country.

Leahy also pointed to the passage in 1982 of the Foreign Missions Act, which, he said, added helpful new tools to monitoring foreign nationals, including a coding system for diplomatic license plates. The system uses red, white and blue as well as a two-letter prefix to denote which country operates each diplomatic vehicle.

The biggest case this year remains the Walker spy ring, which passed secret Navy codes and communications data to the Soviets.

The arrests in that case were followed by a summer of high-level defections in London, Greece and Rome, where a senior KGB official, Vitaly Yurchenko, walked into the U.S. Embassy.

Yurchenko spent three months with CIA debriefers before walking away from CIA custody. He resurfaced in the Soviet Embassy compound earlier this month to accuse the CIA of kidnaping and drugging him. The CIA repeatedly denied the allegations.

Had it not been for Yurchenko's defection, which now is being analyzed to determine whether it was genuine, U.S. intelligence might never have discovered that former CIA agent Edward L. Howard -- drummed out of the clandestine service for his occasional drug use -- had traveled secretly to Vienna in late 1984 to meet with senior KGB officials and agree to sell them secrets about how the CIA conducts spy operations in Moscow.

And after they heard about Howard's alleged spying, U.S. intelligence officials learned that Howard's disclosures to the KGB may have caused the arrest and disappearance of a longtime CIA "asset" in Moscow, an aviation researcher identified as A.G. Tolkachev.

Not only had the CIA never detected Howard's spying after he left the agency in 1983, the FBI's surveillance of Howard's New Mexico home failed to stop Howard's flight in late September when -- based on Yurchenko's information -- FBI officials obtained an arrest warrant for him.

All of these cases have had an impact on U.S. intelligence agencies.

Navy Capt. Brent Baker said yesterday that the revelations about the Walker case "sensitized" Navy officials to security requirements. Baker pointed out that several colleagues of Naval Investigative Service analyst Jonathan Jay Pollard had informed security officials that Pollard was taking an extraordinary interest in classified material outside his field. Pollard was arrested Thursday. "These coworkers tipped off the NIS and the NIS brought in the FBI and away they went," Baker said.

Commenting on the Pollard case, Leahy said yesterday, "If that is so, there has been an attitude shift and people are paying more attention." But Leahy had a warning as well: "We'll see more of these cases in the future.