The government agency that runs both of Washington's airports has the right to ban all political or propaganda advertising inside the terminal buildings, a federal judge has ruled.

By prohibiting such ads, U.S. District Judge Oliver Gasch declared, the Federal Aviation Administration can properly "avoid the sticky administrative problems of allocating a limited number of advertising spaces among political candidates or viewpoints." The FAA operates National and Dulles International airports.

Gasch ruled in a case brought by the registered foreign agent of the National Assembly and Council of Ministers of the Territory of South West Africa/Namibia, a body supported by the South African government and not recognized diplomatically by the United States. Insurgent groups are attempting to gain control of the former German colony, which has been administered by South Africa since World War I.

According to Gasch's ruling, the Namibian agent sought a year ago to erect an advertising display that originally would have consisted "largely of landscapes and animals." But when the final version was proposed a month later, Gasch said, it depicted "terrorist activity and military equipment . . . and written information of an undisputed political nature." The FAA rejected it.

Gasch rebuffed the Namibian contention that the proposed ads were protected by the First Amendment and upheld an FAA policy that he ruled to apply to domestic political as well as foreign ads. Otherwise, he said, the FAA would assume the "appearance . . . of government monitoring of political content."