The United States has ordered two Cuban diplomats here to leave the country by July 25 in retaliation for an extensive media campaign alleging that American diplomats serving in Havana have been engaged in espionage activities, the State Department announced yesterday.

The two Cubans being expelled are Virgilio Lora amd Bienvenido Abierno, both third secretaries in the Cuban "interests section" here, according to department spokeswoman Phyllis Oakley.

The hostile Cuban media campaign, which began July 6, has led to "significant harassment" and "intolerable conditions" for U.S. personnel at the U.S. interests section in Havana, a department statement said.

The campaign had also caused "irreparable damage" to the individuals named in the Cuban media as allegedly involved in espionage activities there and made it impossible for those still there to carry out their jobs, it said.

Despite the allegations, the Cuban government so far has not demanded that any of the American diplomats leave the country.

The Cubans also have been restricting U.S. flights carrying supplies and diplomatic pouches to U.S. diplomats in Havana, further complicating life for American diplomats there, the statement added.

The U.S. government has refused to comment on the espionage allegations disseminated in Cuba "because the United States does not respond to such allegations," Oakley said.

The Cuban denunciations appear to have been touched off by the defection in late May of a Cuban air force general, Rafael del Pino Diaz. He subsequently attacked the regime of President Fidel Castro in a five-hour interview with Radio Marti, the U.S. government-operated radio station broadcasting to Cuba in Spanish.

Extracts of the interview were made available to various U.S. newspapers, radio and television stations last month.