THE COSTS of the German espionage affair are evidently going to run high. At a time when relations between East and West are not very good in any case, this latest affront is a reminder of all the familiar reasons for taking care in trying to improve them. As West Germany's Chancellor Helmut Kohl gloomily observed, it shows "the difference between propaganda and the real situation."

For Mr. Kohl's government, these events are another burden to carry. They won't force him out of office, as a similar scandal did to his predecessor, Willy Brandt, in 1974. But they will become a distraction and point of vulnerability to a government that, at the midpoint of its term, has not been showing much evidence of energy or initiative. A true measure of the losses in security, as inteence specialists measure them, is not likely ever to be made public. But to get a rough idea, you only have to know that one of the defectors was the West German official in charge of hunting East German spies.

That official, Hans Joachim Tiedge, is now in East Germany. It is not clear whether he had been working as a spy over the years. He was ill, the West German government says, and may have gone east to escape a variety of personal troubles. In any event, he took with him a vast knowledge of West German and Allied intelligence methods.

Three others have disappeared in circumstances suggesting a hasty departure to the east. One of them was the personal secretary of Martin Bangemann, West Germany's minister of economics and the leader of the Free Democratic party. Another was a secretary for an association of refugees. The third was an army messenger who had once worked inside the secret command center that the government would use in case of war.

For West Germany, the struggle to control foreign spying is extraordinarily difficult. There is a continuous stream of refugees from the east, and West Germans consider it a moral obligation to welcome them fully into all areas of West German life with no hindrance. Sometimes it means allowing them into sensitive jobs, although they are people about whose backgrounds little can be known.

These defections change nothing fundamental. Everyone knew that East Germany goes to obsessive lengths to spy on West Germany and that West Germany, committed to keep its society open, cannot totally control it. But this episode is a defeat for West Germany in the shadow war.