That was from the annual White House Correspondents Dinner. The White House Correspondents Dinner is where Presidents spoof the issues of the day and make fun of themselves. Comedians write jokes for the president to deliver.
Obama was making fun of the ineligibility movement with that born in Kenya joke.
Another Obama Kenya joke from the 2014 White House Correspondents Dinner: “Let’s face it, Fox News, you’ll miss me when I’m gone. It will be harder to convince the American people that Hillary was born in Kenya.”
Was it also comedy when Obama told his own literary agent he was born in Kenya?