The link between comedy and politics is a celebrated one, the entertainment form being strongly associated with troublemakers and transgressive art. It is not difficult to see why this might be the case. Comedy can depend on a few things to generate laughs, most notably a sense of incongruity or a of transgressing boundaries of taste or delving into taboos. In addition to this, comedians take advantage of the fact that society has a considerably increased tolerance for transgression of social norms that occur in the form of a joke, much exploration of unacceptable taboos like sexism, racism, etc. are acceptable because of this. Comedians also tend to be observers, the basis of much comedy after all is based on astute observation, leading to a set of conditions which allow transgressive comedy to genuinely explore social issues as well as shock, amuse and offend audiences.
However I'm convinced that many comedians take advantage of this to pump out material that is either lazy and uninspired, leaning on our assumption that bold transgression and taboo-breaking must have artistic value, as a cheap trick to stir up controversy and free publicity or as a chance to air thinly veiled racist/sexist/etc views that have very little in the way of subversive or artistic merit.