Bernard C. Welch Jr., the convicted slayer of Dr. Michael Halberstam, was sentenced yesterday to serve a minimum of 143 years at a federal prison facility and within hours was transferred to the federal penitentiary at Lewisburg, Pa.

Shortly after Welch was sentenced, Sol Z. Rosen, the attorney Welch dismissed after his trial for alleged incompetence, declared: "Justice triumphed."

He said that Welch had admitted to him that he committed the Halberstam murder and offered him $50,000 if he could get Welch transferred to St. Elizabeths Hospital here so he could escape.

Rosen, in a letter he released yesterday denying any improper representation of Welch, also said his former client had "asked me to prevent his transfer to a federal institution upon his conviction as he felt he could easily escape from the Lorton Reformatory. He is of the opinion that he can break out of any prison and does not intend to serve his sentence."

D.C. Superior Court Judge H. Carl Moultrie I gave Welch the maximum allowable prison term for 10 of the 11 counts against him -- including the mandatory sentence of 20-years-to-life for the felony murder last Dec. 5 of the 48-year-old cardiologist and author at the Halberstams' Northwest Washington home.

Welch, looking haggard and drawn, listened impassively as Assistant U.S. Attorney Alexia Morrison warned Moultrie that Welch, alleged by local police to have committed hundreds of burglaries in the Washington area, had promised in press interviews to teach others in prision about his life of crime.

The prosecutor also recalled that Halberstam, while trying to drive himself to a hospital moments after he had been shot, rammed Welch with his car and told his wife, Elliott Jones, "That's the guy!" Morrison asked Moultrie to "take advantage of Halberstam's marking that man and bringing him to justice."

Morrison said Welch was a "parasite" beyond rehabilitation, a severe escape risk who deserved the stiffest sentence possible.

Under the sentence Moultrie imposed, Welch must serve the biologically unlikely 143-year term before he can apply for parole, according to Welch's new defense attorney, Alan B. Soschin, and prosecutors. Soschin said later that he thought "the sentence was too long."

Welch, 41, is likely to spend the rest of his life in prison, Soschin said, as he still faces more criminal charges in Maryland and Virginia, and an unexpired prison term in New York State.

Jones did not attend yesterday's sentencing, although Morrison told Moultrie that she would have attended but for her mother's death. Neither did Linda Sue Hamilton, Welch's common law wife.

Soschin asked Moultrie to sentence Welch to a prison term with a reasonable opportunity for rehabilitation and parole. "Our corrections system is not set up to intentionally exile [people] from their family and friends," he said.

Clifford F. Kinney, an official at Lewisburg, said Welch arrived at the federal prison at about 2 p.m., and will spend the next two weeks in an orientation period, after which he will join the general inmate population, which numbers about 1,000.

Besides the felony murder term, Welch must serve eight consecutive terms of 15-years-to-life for four charges of grand larceny and four charges of second-degree burglary. He also was sentenced to the same term for burglarizing Halberstam's house, a term running concurrently to the murder penalty. He also was given a 3-to-10-year term for a weapons charge, which will run consecutively to the other sentences. Because Welch has three prior felony convictions, Moultrie could have sentenced him to a 15-years-to-life term for the gun charge.

Before the sentencing, Soschin protested to Moultrie that Welch's presentence report was "biased" and of questionable value. The confidential document, prepared by a court official for Moultrie's use, said Welch allegedly committed "3,500 burglaries."

Morrison, speaking to Moultrie as spectators in the packed courtroom listened, contrasted Welch with other defendants tried at Superior Court. She said that Welch was "a very different defendant," and produced a $72,000 receipt showing the amount Welch was paid just for the month of April 1980 for allegedly stolen items he sold to a California firm that smelts gold and silver.

"We have a man who took a life -- a man who planned to take a life," Morrisoin said, then contrasting Welch to his victim.

Halberstam, she said, "enjoyed life by giving . . . was utterly devoid of malice" and had saved two lives in the last month of his life.