A federal judge yesterday ordered the Reagan Adminstration to reconsider its decision to close a downtown Washington shelter for the homeless and directed officials at the U.S. Department of Health and Human Services to furnish a "reasoned analysis" of the agency's proposed action by July 31.

The order by U.S. District Judge Charles R. Richey came one day after lawyers for the federal government argued that the 800-bed shelter operated by the activist Community for Creative Non-Violence should be closed as soon as possible because of its squalid condition. CCNV had sued the federal government in an attempt to block the closing and force HHS to transform it into a "model," as President Reagan promised last November.

"We won!" said CCNV leader Mitch Snyder, who called a press conference at the shelter at 425 Second St. NW hours after Richey issued his three-page order. "The federal government can't justify putting 700 people out on the street when they know there is nowhere else for them to go."

Lawyers for the federal government, who had argued that the administration's promise to create a "model" shelter was a "limited commitment" based on a "political decision," reacted more cautiously.

"I'm not going to make any public assessment about who benefits," said assistant U.S. Attorney John Bates. "Our view is that we're reviewing the order and our options." One of the those options, Bates said, is to appeal Richey's order to the U.S. Court of Appeals.

Although Richey announced Monday that he did not plan to rule before next week, sources said he acted quickly because of the government's intention to close the shelter as soon as possible. Richey reportedly wanted to give shelter residents time to comment on the impact of a proposed closing either in writing or at a public hearing which, according to the order, must be concluded by July 25.

The judge also ordered that the federal government post notices in "open and conspicuous places" that provide an address to which comments can be directed as well as the date, time and place of any public hearing. The order does not require that a public hearing must be held.

Although CCNV last month blocked the government's plan to post closure notices in the shelter, Snyder said he had no objection to the government displaying notices that invite comment or announce a hearing. "The problem we have is with eviction notices," he said.

Richey's decision to return the lawsuit to HHS was the course proposed by attorneys for Wilmer, Cutler & Pickering, the firm he appointed several weeks ago to help him sort out the complex legal issues in the case.

At Monday's hearing attorney Michael S. Helfer, who filed the firm's 45-page brief, disputed the government's contention that the promise to repair the shelter was not legally binding. He claimed that the pledge fell under the jurisdiction of the federal Administrative Procedures Act.

HHS, Helfer said, "can change its mind on such matters, but it must provide a reasoned explanation, consistent with its statutory responsibilities, for doing so."

Helfer advised Richey to return the case to HHS and "require it to reach anew a decision with respect to closing the shelter and then explain how that decision accords with its original commitment and the purposes of the statute under which it was to fund the renovation."

Although the federal government had planned to close the shelter by July 31, Richey yesterday scheduled a hearing for Aug. 2, which means the facility will probably remain open until then.