U.S. District Court Judge Barrington D. Parker yesterday declared unconstitutional a law that prevented an avowed Communist from Virginia from enrolling in government job training program.

The ruling was a victory for Dori Blitz, a 36-year-old member of the Communist Workers Party from Martinsville, who was barred from a federally sponsored program that taught brick masonry. Parker directed the Labor Department to ensure that her application for the program, funded by the Comprehensive Employment and Training Act (CETA), be reconsidered "without regard to her political affiliations or beliefs."

The judge, in a 12-page decision, vehemently rejected arguments in support of a federal amendment that Virginia officials invoked to deny Blitz a chance to complete the training. That amendment, which Parker referred to as the "Blitz amendment," was added by U.S. Rep. W.C. (Dan) Daniel (D-Va.) to an appropriations bill and was aimed at barring Blitz and her husband CETA benefits because they had advocated the violent overthrow of the government.

" . . . while CETA workers who advocate the violent overthrow of the government might be ingrates, the Constitution protects them as well as the appreciative," Parker wrote.

Attorneys at the Justice Department have not had time to decide whether to appeal, a spokesman said, and Daniel was not available for comment. His measure was passed by Congress without objection.

"It's a terrific decision," said Mark Lynch of the American Civil Liberties Union, which challenged the law on behalf of the Blitzes. "It's not every day that acts of Congress are knocked off the books."

The case attracted numerous supporters who said it was a direct attack on freedom of speech, a view that Parker upheld. "The legislative history of the amendment left no doubt that it was specifically intended to exclude Mrs. Blitz from the CETA program because of her political beliefs and affiliations, and because she expressed those beliefs in her community," he wrote. " . . . the First Amendment clearly bars the government from penalizing mere advocacy of an idea, including violent revolution."

Blitz described the decision as "a partial victory," and said the case was "only one in a string of attacks by rightwingers, people like Reagan and Daniel." She has publicly identified herself as a Communist since moving to Martinsville with her husband 4 1/2 years ago.

Blitz, who recently lost a city council election in Martinsville, was not allowed to complete the masonry program when she sought to return to it after maternity leave.

Her husband, Allen Blitz, has a similar case against Henry County, Va., officials that is scheduled to be heard in a state court on Tuesday.