Philip Agee and mark Hosenball, two American writers who have exposed secrets of Western spy agencies, today lost their appeals and were ordered out of Britain as security risks.

The decision, announced by Home Secretary Merlyn Rees in the Commons, provoked angry cries of "disgrace" and "Czechoslovakia," mostly from his own fellow Labor members of Parliament but also from Liberals. Conservatives, however, cheered Rees.

Neither Agee, 41, nor Hosenball, 25, have ever been told of the specific charges against them or allowed to crossexamine their accusers. Rees said that to disclose this information would "risk the lives of people who work for the state."

This denial of the right to cross-examination has struck many here as a deprivation of civil rights and aroused protests today from both left and right-wingers in the Labor Party.

The procedure was invoked by the home secretary for the first time under a little-noticed provision of a 1971 immigration act.

The act allows no appeal in a court of law. Britain has no written constitution or bill of rights and Parliament is sovereign. In this situation, Parliament has given the home secretary a free hand and no court can declare, as it might in the United States, that the law has breached a right of due process.

Both Agee and Hosenball did take advantage of a provision of the law that permitted them to make "representations" to an advisory panel of three retired civil servants who then gave secret advice to Rees that he was free to accept or reject.

The writers brought in dozens of witnesses and exhibits testifying to the harmless nature of their activities. But they could never come to grips with the charges against them because they were not allowed to know what they were.

Home Office officials said they would not object if the Dutch authorities accept him.

The whole affair is a mysterious episode in British law and politics. Sources familiar with the files have said the neither American committed any act of espionage. The writings of both, however, have been a distinct source of embarassment to the CIA and its British counterparts.

Agee is a former CIA officer in Latin America who resigned in 1969, declaring that the agency had systematically and illegally interfered with the internal affairs of friendly countries. He detailed his experiences at length and named many agents in a global best-seller, "CIA Diary."

Today, Rees angrily denied in the House of Commons that he had acted in response to CIA demands. "There have never been any representations from the American government or any American agency," he said. Knowledgeable officials here indicated however, that there was some pressure from the CIA but that it was "minimal."

The original deportation order issued against Agee here last November said that he had "maintained regular contacts harmful to the security of the United Kingdom" and "disseminated information" that hurt British security.

The "contacts" have been identified as Cuban. Agee has insisted repeatedly that he has sought out Cuban diplomats here only to discuss printing his CIA book in Havana.

The agency has charged that Agee's technique of naming agents led directly to the assassination of Richard Welch, the CIA saigon chief in Athens.