ATLANTA — Kenneth Tate toiled for years as a construction worker and corrections officer, and he has no doubt that his last job — working as a $42,000-a-year private security guard at the Centers for Disease Control and Prevention — was the best he ever had.

The high point was an afternoon seven weeks ago when he was assigned to accompany President Obama, who was visiting the agency’s headquarters here for a briefing on the Ebola epidemic. It was not only that Mr. Tate’s bosses had entrusted him with staying close to such an important dignitary. It was that, as an African-American born in Chicago, he was going to meet the nation’s first black president, a man he deeply admired.

But by the time Mr. Obama’s visit was over, Mr. Tate was on the way to losing his job.

As Mr. Obama’s motorcade was preparing to leave the C.D.C., Mr. Tate tried to take a picture on his cellphone as a memento. Angry Secret Service agents told him that he had gotten too close to the Beast, as the presidential limousine is known. When the agents relayed to Mr. Tate’s bosses what had happened, they reacted angrily.

“This was unjust and has been a nightmare,” Mr. Tate, 47, said in an interview last week. “I’ve tried to rationalize it. It won’t go away.”