The highest ranking government official caught up in the corruption probe that rocked the General Services Administration was sentenced here today to six months in prison for accepting an illegal gratuity from a government contractor.

Albert A. Matera, formerly one of three supervisors overseeing GSA retail operations for the mid-Atlantic region, also was placed on two years probation. Matera, 66, a retired Army lieutenant colonel, had pleaded guilty to the charge five days after his indictment last May.

He retired from his $35,000-a-year government post five months before his indictment.

Matera told U.S. District Court Judge C. Stanley Blair that he had arranged to buy $1,300 worth of carpeting for his Alexandria home through the contractor, Thomas R. Willingham, and had intended to pay for it when retired from the GSA. He delayed his retirement because of family health problems and had not yet paid Willingham when the FBI questioned him, he said.

Willingham, president of Atlantic Office Supply Co. Inc. in Bladensburg, was sentenced earlier this month to 10 months in prison on a charge of conspiracy to defraud the government by bribing GSA employes and failing to deliver merchandise.

Since the Justice Department began its investigation of the federal house keeping agency nearly two years ago, at least 69 people have pleaded guilty or been convicted.