WASHINGTON (AP) _ A lawyer for 21 rabbis convicted of demonstrating too close to the Soviet Embassy said Friday they will appeal the verdicts, and he claimed the Reagan administration prosecuted them ''because the Soviets asked for it.''

District of Columbia Judge Colleen Kollar-Kotelly found the rabbis guilty late Thursday, fined them $50 apiece and put them on probation for six months. She suspended 15-day jail sentences but said that penalty would be reinstated if they violate any laws while on probation.

Attorney Dan Goldstein, representing the rabbis, said ''these people were prosecuted because the Soviets asked for it.'' Attorney General Edwin Meese III ''did it, and it looks like he does what the Soviets ask,'' Goldstein said.

Prosecutors in the District of Columbia work for the Justice Department, headed by Meese.

The rabbis were arrested June 10 in front of the embassy and charged with breaking a city law requiring protesters to stay at least 500 feet away from an embassy.

It is the same law broken by nearly 3,000 anti-apartheid demonstrators over the last year in front of the South African Embassy. Charges against them routinely have been dropped.

''I think we all remain quite upset that these people are being prosecuted while those at the South African Embassy are not,'' said Mark Epstein, a spokesman for the Union of Councils for Soviet Jews, which sponsored the demonstration as part of a series of protests at the Soviet Embassy.

''We are not commenting on those claims,'' said assistant U.S. attorney Clendon Lee.

The judge rejected Goldstein's ''necessity defense,'' an argument that the rabbis' act was necessary to prevent ''the persecution of Jews in the Soviet Union.''

Goldstein said they would appeal not only on grounds that the demonstration was necessary, but that the law against such protests violates the First Amendment right to free speech and that anti-Soviet protesters are being singled out.

About 20 other Washington-area rabbis are facing trial next week on charges that they demonstrated too close to the embassy in May.

The 21 rabbis convicted Thursday were Asher Ostrin and Jeffrey Wohlberg, both of Harrisburg, Pa.; Mark Staitman of Pittsburgh; Donald R. Berlin, Floyd Herman, Earl A. Jordan, Mark G. Loeb, Elias Lieberman, Alan Londy, all of Baltimore; Alan Cohen of Charleston, S.C.; Seymour Essrog of Randallstown, Md.; Oscar Groner of Rockville, Md.; Martin S. Halpern of Silver Spring, Md.; Allen Juda of Bethlehem, Pa.; Allan Meyerowitz of Spring Valley, N.Y.; Philip Pohl of Olney, Md., Jonathan Schnitzer of Easton, Md.; Samuel Scolnic of Bethesda, Md.; Richard Sterneberger of Washington, D.C.; Jonathan S. Woll of Hagerstown, Md.; and Theodore Feldman of Boca Raton, Fla.