Life is a funny thing. So funny, in fact, that people are able to make a living off of sharing their observations about just how funny life can be. These people, of course, are comedians.
The practice of stand-up comedy is said to have originated in ancient Greece, where people would use it as an outlet to discuss and poke fun at life without being censored. Today's comedians use the spotlight for a similar reason: to share anecdotes and (sometimes off-color or vulgar) remarks about the state of the world and life itself.
However, it is not uncommon for people to take offense for some of the things these people can get away with saying in the name of comedy. For example, popular sketch comedy show Saturday Night Live has been poking fun at President Trump even before he officially announced his candidacy in the 2016 election. As you might expect, staunch supporters of him were not too happy and viewed the satirical representation of him as offensive.
In 2015, the newly named host of The Daily Show, South African comedian Trevor Noah, tweeted a series of jokes that ranged from sexist to fat-shaming to antisemitic which obviously garnered some criticism from the public. So why is Noah still the host of the show, and why has Comedy Central extended his contract to 2022 if what he said was so distasteful and offensive? Why can comedians get away with saying so much and be let off the hook by saying it was a joke?
The answer is simple: Peoples' senses of humor are incredibly unique and subjective. For every person who was disgusted and appalled by Noah's off-color tweets, there was another who found it funny. While it may seem strange to you that people would enjoy jokes about sensitive subjects such as the ones he talked about, some obviously do.
The nature of the entertainment business is unique in that it is almost entirely governed by the tastes and preferences of the public. If a significant enough amount of people find something entertaining and worth their time, then that thing will continue to do well and stay relevant. This can most definitely be applied to comedians as well.
Senses of humor vary greatly between individual people, generations, and even geographical locations, and what one person might find hilarious, another person may not find funny in the slightest. Comedians must do their best to find and appeal to a specific comedic niche in order to be successful, whether that be slapstick, political, or dark comedy (to name a few).
So, long answer short, comedians can get away with saying things that might seem offensive and distasteful because someone, somewhere is entertained by what they have to say (even if it might not be your cup of tea). The moral of the story is comedians are free to make whatever jokes they want. If they're funny to you, great! If not, just remember that it might just be making another person laugh out loud.