A gala, black-tie retirement ceremony for a Army lieutenant general, complete with military color guard and a letter of congratulations from President Reagan, turned into a big pain for organizers this week when at least 41 of the 72 celebrators fell ill with apparent salmonella poisoning from food served at the Fort McNair officers club here.

Four persons remained hospitalized yesterday with intestinal problems, and medical officials investigating the incident have focused their attention on roast beef served at the event Sunday that may have been undercooked.

The food poisoning outbreak, confirmed this week by investigators at Walter Reed Army Medical Center, sent a number of high-ranking, retired Army brass and their wives reeling.

News of the poisoning also dampened what otherwise had been a glittering affair put on by Washington area alumni of the Valley Forge Military Academy to honor the outgoing superintendent, retired Lt. Gen. William Pearson.

"I felt extremely bad that this happened. We spent a number of months putting this together and it turned out to be an absolutely fantastic evening," said lawyer William Schmidt of Springfield, a graduate of the academy in Valley Forge, Pa., and one of the chief organizers. " . . . Probably 50 percent of the people who were there certainly were close friends of mine."

Members of the alumni association here had arranged through the White House to give Pearson, 70, a letter from the president and a picture of Reagan.

"I'm fine. I had diarrhea," Pearson said yesterday from his home. "I got it the next day around 4 o'clock and it's pretty well subsided . . . . It was a beautiful ceremony."

Peter Esker, spokesman for Walter Reed, said a medical team investigating the outbreak has concluded tenatively that roast beef served at the dinner was not cooked to a required temperature, but researchers also are studying sour cream served on baked potatoes.

Esker said food samples are being tested for the bacteria at a laboratory at Fort Meade. Meanwhile, an Army spokesman said the officers club at Fort McNair in Southwest Washington has resumed normal food service operations after a health inspection.

"They inspected the entire kitchen," Esker said. "It's the feeling of our people that it was a preparation problem and not a cleanliness problem."

Participants in the event came in tuxedos, gowns and full military dress uniforms. Among the guests, Pearson said, were retired Gen. James H. Polk, former commander of Army troops in Europe, and retired Lt. Gen. Harry W.O. Kinnard, former chief of the Army's Combat Development Command.