A former Riggs National Bank vice president was sentenced yesterday to six months in prison, fined $10,000 and ordered to perform 1,000 hours of community service by a federal district judge here who said the penalties should "send a message" to bank officials who launder drug profits.

"This needs to be stopped," said U.S. District Judge Thomas F. Hogan as he sentenced William G. Hessler, 48, who pleaded guilty last month to not reporting to the Internal Revenue Service a $450,000 cash deposit that prosecutors said represented the proceeds of a cocaine distribution ring that smuggled the drug from Columbia and sold it in the United States.

Hogan, who told Hessler that he would have imposed the maximum sentence of five years in prison and a $500,000 fine if he thought that the former manager of Riggs Watergate branch knowingly had laundered the money, called the banking industry the "crucial" link in allowing drug dealers to channel their profits into legitimate business.

"Didn't it cause you any concern" when former Washington lobbyist Fred B. Black Jr. showed up at the bank with nearly $500,000 in cash crammed in a shopping bag, Hogan asked Hessler.

"No, sir," Hessler replied. Hogan then said that he was "surprised by some of the things that went on at the bank."

U.S. Attorney Joseph E. diGenova said prosecutors were "very pleased, very satisfied" with the sentence imposed on Hessler, of 11832 Dinwiddie Dr., Rockville, who resigned from the bank in June 1983, three weeks before he was indicted in connection with the drug ring, which prosecutors said was led by his brother-in-law, Lawrence G. Strickland Jr.

"The signal sent, obviously, is that bank officials, who can be the first line of defense in the community against money laundering by international drug dealers, can be held accountable," diGenova said.

Hessler is the 14th person convicted in the case, which is the first brought here as a result of an investigation by the Organized Crime Drug Enforcement Task Force formed by the Reagan administration in 1982. At his trial in June, Hessler was acquitted of six charges of misusing bank funds, mail fraud and failure to report taxable income, but the jury could not reach a verdict on 17 other counts.

In the same trial, Black, 71, was convicted of three counts of income tax evasion and, in a separate trial, was convicted with three other defendants, of conspiracy to import and distribute cocaine. He is serving a seven-year prison term.

Assistant U.S. Attorney Roger Adelman told Hogan that Hessler is different from the others in the case because he "occupied in his career a position of trust." Despite Hessler's guilty plea, Adelman said, Hessler "perpetuates the myth" that he has done nothing wrong.

According to testimony during the trial, at the time that Hessler extended unauthorized bank loans to Black, he borrowed $40,000 from Black to help buy the house in which Hessler lives. Prosecutors alleged the money was a bribe; Hessler said it was a loan.

A financial statement filed in court indicated that Hessler does not expect to repay the $35,000 loan balance because the money was used to pay legal expenses "caused by Black and Strickland."

Edgar Wilhite, Hessler's lawyer, said his client was "strung along" by Black, whom Hessler said he considered "almost as a father to me," and that no one at Riggs knew much about the cash transaction laws.

Hessler told Hogan: "I still deny the charge concerning this case."

As a result of the case, Hessler said, "Now I'm a self-employed, blue-collar laborer . . . . My direct family is close to financial ruin."

Hogan imposed a three-year jail term, suspending all but six months, and ordered Hessler to work 500 hours in sports programs for poor and handicapped children and to spend 500 hours raising money for the American Cancer Society.