Two Charlotte policemen who had been granted immunity from prosecution were ordered to jail today after they refused to testify before a federal grand jury probing police misconduct.

The order, which was stayed five days for appeal and which was stayed five days for appeal and which will be lifted if the two agree to testify, came after the policemen had repeatedly refused to testify before a federal grand jury probing allegations that the Charlotte Police Department engaged in illegal wiretapping and covered it up.

The matter also involved a feud between the Charlotte police chief and The Charlotte Observer, which published the articles leading to the official investigation.

Among the figures connected with the controversy:

Police Chief J. C. Goodman, 60, a 36-year veteran of the Charlotte police force who rose through the ranks to become chief nine years ago, and who now stands accused of ordering wiretap tapes destroyed.

The Observer, considered one of the South's strongest newspapers with a national reputation for investigative reporting.

U.S. District Court Judge James B. McMillan, whose decision ordering busing for Charlotte school desegregation was ultimately adoped in a landmark Supreme Court ruling and who voiced strong reservations today about compelling immunized witnesses to testify.

Guy L. Goodwin, a Justice Department attorney whose grand jury probe of radicals during the Nixon era and wide use of immunity to compel testimony became embroiled in controversy.

Goodwin is assisting Keith Snyder, U.S. attorney for western North Carolina.

McMillan's order came just hours after Goodman filed a $13.5 million libel suit against the Observer, the two Observer reporters who wrote the police story and a former Charlotte policeman who has been granted immunity in return for testimony.

The controversy involving the police department came to public notice March 6 when the Observer published an article based on unnamed sources saying Charlotte police officials had illegally wiretapped suspects in more than a dozen narcotics cases during 1972 and 1973 and that when Goodman found out about it he ordered tapes from the wiretaps destroyed.

Goodman denied any knowledge of illegal police wiretapping, and began refusing interviews with the Observer, saying, "I don't talk to my adversaries."

The police chief repeated his position when the Observer reported March 27 that the police department had maintained secret intelligence records on political and religious leaders and college professors in the 1960s and 1970s.

The articles were entered into the court recored as part of the libel suit. Goodman's suit denied all the charges.

On April 1, Goodman asked the Observer for a retraction. Observer editor David Lawrence said then the newspaper would stand by its articles.

Federal grand jury began hearing witnesses in the case April 4, with former policeman Allen L. McCoy, a specialist in electronic surveillance, testifying for two hours after being granted immunity from prosecution.

Subsequent grand jury sessions took testimony from numerous Charlotte police officers.

By May 7, police officials not involved in the case were saying anonymously for publication that the probe had had a serious affect on police morale. Three days later McMillan ordered a contempt hearing for the two officers involved in today's order after they refused to testify May 3. The two had been granted immunity from prosecution earlier.

In federal court today McMillan ordered 90 days in jail for patrolman Michael F. Greene and Sgt. George W. Nesbitt. The first 30 days of the contempt jailing was ustended pending payment of a $200-day-fine by each of the policement.

McMillan, before reading his order, related the procedures follwed under the immunity statute, and said, "I think all of you know I would not take the third step [punishment] it if were not for my oath of office."

The judge said it was his opinion that compelling testimony through the use of fines or imprisonment is "not dissimilar to torture."

"That is beside the point, unless a judge is to go by his conscience as a rule of law," he said.

Goodwin asked that McMillan include in his order a provision that the $200-a-day fine not be paid by anyone other than the two men. McMillan said he had considered that idea and decided against it.

Attorneys for the two men say an appeal is likely.