William Franz, a divorced father, has not seen his children since Christmas of 1977 in spite of his attempts to do so. The reason: His ex-wife married a mobster who took on a new identity and disappeared into the federal witness protection program with her and the three Franz children. The Justice Department, Franz alleged, has refused to allow him to see them.

However, the U.S. Court of Appeals in Washington gave him new hope Tuesday in ruling that the Justice Department had infringed on Franz's constitutionally protected right to have the companionship of his children. The appeals court ordered the case back to U.S. District Court in Washington for it to hear Franz's suit against the Justice Department. That court had earlier thrown out the suit.

Franz, 36, a Philadelphia printer, said yesterday: "I feel great about the decision." Describing his feelings about being deprived of seeing his children as "sheer hell," he said, "I had enough problems about seeing them before, and then the Justice Department came along."

After Franz and his wife divorced, she married Charles Allen, a self-confessed contract killer for organized crime figures in Philadelphia. Then just after Franz last saw his children, Allen went into the witness protection program, which gave the entire family a new identity and relocated them to an undisclosed part of the country.

Since that time, Franz has sent letters to his children but has received no reply, he said in the interview. Neither his former wife, Catherine, nor the Justice Department has permitted him to visit them, Franz said in his complaint. Indeed, he says, he has no way of finding out where the children are.

U.S. District Court Judge Barrington D. Parker had thrown the case out of court in 1981, saying, in effect, that Franz had no claim against the government. In making that determination, Parker had cited another court's decision that the parent with custody--in this case, the mother--presumably has proper concern for the children's welfare and should win out.

Citing Supreme Court decisions, appeals court Judges Harry T. Edwards, Edward A. Tamm and Robert H. Bork held, however, that freedom of personal choice in matters of family life is a "fundamental liberty interest protected by the Constitution." Among the most important of these liberties, the appellate judges said, is the freedom of a parent and child to "maintain, cultivate, and mold their ongoing relationship." The judges said they were making no determination on what the lower court should ultimately decide.

Writing for the court, Judge Edwards said officials of the U.S. Marshals Service, which operates the witness protection program, had acknowledged they could safely set up meetings between Franz and his children without endangering Allen. But they had refused to do so without the consent of Franz's former wife, the court said. Franz said in the interview that his ex-wife would not give such permission.

John K. Russell, a Justice Department spokesman, said the department would have no comment until it has had a chance to study the opinion.

A separate opinion by Bork has yet to be issued.

A federal prosecutor who has used Allen's testimony several times to obtain convictions of mobsters said of the case, "It's a difficult problem. I sympathize with him Franz . It can't be resolved very easily."

Franz said yesterday he encountered difficulties in seeing his children even before they went under the cover of the witness protection program. Several times, he said, the family moved without letting him know where they had gone. After the family received a new identity, he said, he had no idea what had happened to his children.

"I have to practice every day trying to keep my serenity," he said. "I have no way of knowing what they are thinking, or how they are functioning."

"I wrote them a letter 10 days ago. I send them cards for their birthdays," Franz said, adding he has no idea if the children have ever received his communications.

So far, he said, he has gone through three lawyers while pursuing his case and has spent $13,000 in legal fees. The appeals court decision, he said, is "the best thing so far" in his protracted legal fight to see his children.

The case illustrates some of the problems with administering the witness protection program, which costs $28 million a year and brings in 300 new witnesses each year.

Last month, the General Accounting Office, the auditing arm of Congress, reported that former criminals shielded by the program have been allowed to evade millions of dollars in debts and have committed new crimes--including murder--while under the protection of the government.

Howard Safir, who heads the program, responded at the time that many of the problems have been resolved by a new policy permitting Justice officials to disclose the identities of witnesses who refuse to obey court orders.

Sen. Max Baucus (D-Mont.), who requested the GAO report, subsequently introduced legislation that would set up a court procedure for reviewing such requests.