The joke is the latter. The woke college grads who write the shows think it's funny to have/lampoon racist characters. However, it is a staple of the fare that these characters must exist in the shows to add foils and character depth.
Case in point, there is a class at UCLA titled "Law of Elon Musk". I assume we both agree this class hasn't been polished for decades. And I imagine it's decidedly different than any prior class in related topics.