The chief accounting officer of the D.C. Corrections Department has pleaded guilty in D.C. Superior Court to taking more than $22,000 from an inmate trust fund.

The officer, Samuel F. Shaw, had a prior conviction for embezzlement, a fact Corrections Department officials said they knew when they hired him.

"If you practice what you preach, you have to make an investment in faith," said one top department official, who asked not to be identified. "You can never, never know," when someone is going to break the law, the official said, adding that the department has hired several ex-offenders and has not had problems in the past.

Shaw, 40, has been with the department for about 10 years and had earned a reputation as a "good, hard-working employe," the official said. "I guess the temptation just got to be too much for him."

According to prosecutors, Shaw took the money from the fund in three separate incidents between February and June of last year. He pleaded guilty Dec. 30 to one count of larceny, which carries a maximum penalty of 10 years in prison and a$1,000 fine. He is scheduled to be sentenced Feb. 11.

His attorney, John A. Shorter Jr., said yesterday that Shaw was convicted 20 years ago of embezzling funds from a private company in the District of Columbia. Shorter declined to give further details of that incident.