Thing about it is,
based on how badly and regularly Trump disparaged Obama prior to the Correspondents Dinner event, Obama had every right to return the favor, even though Obama's jabs were jokes, while Trump's disparagement was deadly serious.
Lesson: If you can't take it, then don't dish it.