Four congressmen have asked President Reagan to withdraw controversial regulations that would bar some voluntary non-profit groups from soliciting donations from federal workers as part of the Combined Federal Campaign.

Following up on a Reagan executive order, the Office of Personnel Management (OPM) issued new rules this week that would close the campaign to most groups not directly involved in health and welfare services. The OPM issued the rules despite a U.S. District Court judge's ruling last month that the executive order was unconstitutional.

Under the regulations, groups such as the United Way and the American Heart Association would be included, and groups such as the Wilderness Society and National Organization for Women's Legal Defense and Education Fund would be excluded.

The congressmen, led by Rep. Jack Brooks (D-Tex.), told Reagan that the OPM should abide by Judge Joyce Hens Green's decision, and that issuing rules to the contrary was "a very risky proposition." Green had said there was no constitutional basis for excluding groups the way the administration had said it would.

As a result of Green's ruling, nine groups that would have been excluded under OPM's rules have been approved for participation in this year's campaign. However, dozens of other national and local groups still would be excluded.

"We are seriously concerned that eligibility of charities to receive federal employe contributions should be based on fair, objective criteria which do not exclude bona fide charaties and which are in conformance with recent court decisions," wrote Brooks, Rep. Frank Horton (R-N.Y.), Rep. Barney Frank (D-Mass.) and Rep. John R. McKernan Jr. (R-Maine).

A preamble to OPM's rules said they would take effect only if Green's decision were overturned by an appeals court.

"If we win the appeal, we need to have rules in place to carry out the president's directive," OPM general counsel Joseph A. Morris said. "If it is upheld, then we will have to rewrite them. The point of the rule is to let the court know what the flesh is on President Reagan's skeleton executive order ."

"The fundamental objective is not to exclude legal defense and advocacy organizations, but to provide a channel to generate financial support for human health and welfare charities," Morris said. "It is a setting of priorities; we don't have the time to solicit from everybody."

But Timothy Saasta, of the National Committee for Responsive Philanthropy, said that one thrust of the rules is to "eliminate charities that fight discrimination."