Linwood Gray, acquitted of directing the largest heroin operation ever prosecuted in the District of Columbia but convicted on tax evasion charges last month, was sentenced to a minimum of 20 months in prison yesterday.

Four of Gray's codefendants, who were convicted on drug-related charges in the two-month trial in U.S. District Court, received sentences ranging from probation to six years in prison.

The sentences, imposed by Chief Judge William B. Bryant, were termed a "true tragedy" by Assistant U.S. Attorney Barry M. Leibowitz, who was shot and wounded while he was investigating the drug-smuggling ring. Leibowitz said yesterday's sentences as well as earlier drug sentences by federal judges here in cases termed "major" by prosecutors, "confirm that the dealing of dope in the District is much safer than it is in most other states.

Gray's attorney, Kenneth Michael Robinson, said the government's continued claims that his client was a heroin kingpin who enforced his rule over the alleged drug ring by slayings and shottings are based on "unsubstantiated, uncharged and unproven allegations."

Robinson said the government had failed in its "witchhunt for Linwood Gray," and reiterated his client's testimony that the $300,000 he is alleged to have spent over the last few years came from bank robberies he committed in the 1960s and not from drug sales.

Gray, who thanked Judge Bryant for the way he handled the trial, said he is not a "hostile person. Sure, I was a bad kid, but I'm not a bad man."

In imposing, Gray's 20-month-to-five-year sentence, Bryant rejected a plea by U.S. Attorney Carl Rauh that Gray be sentenced to the maximum 10 years on tax evasion charges. Rauh said the Gray prosecution represented a "major tax case," and that despite the jury's acquittal of him the government still views him as "a dangerous man . . . a threat to the community."

The government had alleged again in a pre-sentencing brief filed with the court that Gray was responsible for five murders and two shootings, including that of Leibowitz. But Bryant noted yesterday that Gray had not been tried in connection with any of those allegations.

Robinson joked that based on the tax evasion verdict, the only threat to the community represented by Gray was the possibility that he could "beat people to death with dollar bills" because he at one time had so much money.Robinson asked that Gray be treated like other white-collar criminals, and given probation or a short prison term.

Leibowitz asked that the other four codefendants be given long prison terms for their alleged roles in the "largest narcotics conspiracy in the history of the District of Columbia."

The government had claimed that the ring brought 200 pounds of heroin with $30 million into the District from Amsterdam.

Bryant imposed the following sentences:

George F. Carter III, 33, of 3447 25th St. SE, five-to-15 years to be served concurrently with a 12-year prison term for drug smuggling that he is already serving.

Richard Tillman, 36, of 2621 Bowen Rd. SE, 15 months to six years.

Smith D. Hammond, 22, of Chicago, an indeterminate term not to exceed seven years under the Young Adult Offenders Act.

Irene Taylor, 42, of 2300 Goodhope Rd. SE, five years' probation and 100 hours of community service work.

The defnese had argued during the trial that the real drug kingpin in charge of the heroin smuggling ring was Bob (Nighthawk) Terry, a radio disc jockey who has been missing for two years. The government contends that Terry is dead and that Gray was responsible.