Punching up vs. punching down.
Is the punch line a stereotype? It’s not funny; it’s reinforcing harmful tripes.
Is the punchline highlighting hypocrisy in society or politics? Great. It’s transgressive social commentary.
Not every person can make every joke because not every person has the experience and nuanced view of particular social groups. White people may be limited to seeing people of color through racist stereotypes whereas people of color can make jokes that go beyond those age old assumptions; the latter makes comedy that’s for proper of color, not using people of color for the benefit of white folks.