A federal judge yesterday struck down as unconstitutional a Reagan administration order barring legal defense funds, including several environmental, civil rights and women's groups, from participating in the Combined Federal Campaign (CFC).

The campaign is the only way charitable groups can solicit federal employes legally in their work places. Legal defense funds collected $2 million nationwide in the campaign last year.

The administration earlier this year announced plans to exclude from the CFC all groups that engage in "political activity or advocacy, lobbying or litigation on behalf of parties other than themselves." One announced aim of this policy was to bar legal defense funds, according to court papers.

However, U.S. District Court Judge Joyce Hens Green ruled here that this violated the First Amendment rights of the defense funds, and ordered that they be allowed to participate.

"It is firmly settled that under our Constitution the public expression of ideas may not be prohibited merely because the ideas are themselves offensive to some of their hearers," Green wrote, quoting a 1969 federal court ruling.

Administration officials said they have not decided yet whether to appeal the ruling. The campaign, which extends to all 4 million U.S. employes--civilian and military--begins in September.

"We hope the administration will accept this very clear and definitive decision and accept the constitutional requirement that we be allowed to participate in this program," said James M. Nabrit III, associate counsel of the Legal Defense and Educational Fund, the lead plaintiff in the case. "Workers ought to be entitled to give to whatever charity they want to give to," he added. "A group of organizations such as ours should not be singled out and denied the right to make a charitable solicitation."

Office of Personnel Management Director Donald J. Devine has said the administration feared some employes would boycott the campaign if legal defense funds were included. He mentioned possible union boycotts if the National Right to Work Legal Defense Foundation participated.

Other plaintiffs: Puerto Rican Legal Defense and Education Fund, Federally Employed Women Legal Defense and Education Fund, Indian Law Resource Center, Lawyers Committee for Civil Rights, Sierra Club Legal Defense Fund and Natural Resources Defense Council.