It takes about 10 seconds for the funniest moment in Ted 2 to become the worst. Mind you, “worst” in a movie like this — one from Seth MacFarlane, whose sense of humor generally bodes about as well for moviegoers as a dorsal fin does for swimmers — doubles as a badge of honor. The movie’s opening title sequence is a musical number in which Ted — that magical teddy bear first brought to insult-comic life by MacFarlane in 2012 — and dancers in formalwear frolic around a skyscraping wedding cake. It’s like something out of Mel Brooks but utterly sincere. The bear slides along a piano keyboard and leaps along the male dancers’ top hats. The leaping feels right for MacFarlane and Ted 2. He won’t be happy until he has danced on your head.

Anyway, that moment. It’s at a fertility clinic. For this sequel, Ted has wed his girlfriend, Tami-Lynn McCafferty (Jessica Barth), and after that wedding cake sequence, the movie flashes forward a year to a life of shouting matches in their Boston apartment. Their fellow supermarket cashier, Joy (Cocoa Brown), senses discord and crassly suggests a baby. But Ted is anatomically ill-equipped to create one — or to provide adequate sexual pleasure, as Tami-Lynn might add in a Boston accent that has traveled the I-95 corridor from Queens. After some fruitless digressions, Ted asks his dim, luckless, nominally human best friend, John (Mark Wahlberg), to donate his sperm, which leads to the clinic, where John is childishly eager to show Ted his load in a room piled high with the canistered donations of other men.

You never expect a movie to hurt you. Disappoint? Dismay? Depress? Fine. But when a movie has a field day asserting the humanity of a fake toy bear at the expense of your own, it hurts. I was led to believe, in part by the posters, that I was getting a movie about a character who’d be masturbating or urinating with his back to us. They should’ve turned Ted around since the emissions are aimed at the audience.

One giant rack of apparently unfastened containers falls on John, leaving him soaking and screaming on the floor. Ted laughs. So do we, because watching Walhberg degrade himself this emphatically is funny. It’s one of the few times in any movie that an emotion really surfaces on his face, and that the emotion is disgust somehow makes it funnier. Someone from the clinic comes in alarmed, but says not to worry. John’s only been doused with the unusable sperm of men with sickle cell. There’s no explanation of sickle cell’s being a blood disease that potentially affects the health of about 100,000 Americans, most of whom are African American. There’s just Ted, connecting the dots enough to say, through his laughter, that John shouldn’t feel bad. “You see that? You’re covered in rejected black guys’ sperm,” he says. “You’re like a Kardashian!”

It’s possible that at the theater where you watch this movie, the initial laughter will be too loud to hear Ted’s punch line. But I imagine that if Kanye West were to wind up in the audience, the punch would feel actionably real. MacFarlane’s inept attempt to meat-grind race into comedy doesn’t end there. Ted and John share a running joke about the predominance of black penises on the Internet. (You’re always no more than two clicks away, John more or less says.) And when Ted and Tami-Lynn discover that — because she was once a junkie-whore — children aren’t possible biologically, they attempt to adopt, only to be told that Ted isn’t a human. He’s property. There goes his cashier job, his bank account, and his dignity. There also went my patience.

The movie turns Ted’s fight for personhood into its cause. For representation, they wind up with Amanda Seyfried as Samantha, an expensive attorney’s much cheaper niece, who dashes off some of the civil rights movement’s greatest legal hits to brush up on the case, all while getting stoned with her clients and surfing a John Hughes–style montage of high jinks. Maybe this is why they lose the case and take a road trip to Manhattan to convince an actual civil rights lawyer to take up their cause. He’s played by Morgan Freeman, whose participation suggests a customized script in which references to black semen and black penises have been redacted. It’s strange enough that Freeman would endorse MacFarlane’s bankrupt evocations of justice and equality by loaning the movie his movie-god status — but a film like this demonstrates the hollowness at the core of that omnipotence: He’s basically doing butler work for the bear.

Universal Pictures

You never expect a movie to hurt you. Disappoint? Dismay? Depress? Fine. But when a movie has a field day asserting the humanity of a fake toy bear at the expense of your own, it hurts. I was led to believe, in part by the posters, that I was getting a movie about a character who’d be masturbating or urinating with his back to us. They should’ve turned Ted around since the emissions are aimed at the audience.

It’s tricky. MacFarlane would seem to identify as progressive, but he uses his liberalness conservatively, to berate what he thinks is normal or safe or established in American culture. His tolerance is tinged with intolerance. In Ted 2, Michael Dorn and Patrick Warburton play a brutally masculine, interracial gay couple. Dorn played Lieutenant Worf on Star Trek: The Next Generation. Warburton, among other characters, played a live-action TV superhero called the Tick. Here they show up at New York Comic Con in their respective costumes and lay waste to nerds. At that moment, the gag moves from their being absurdist gays (“We’re gonna tie our dicks together”) to their being bullies irrespective of their gayness. Where precisely the joke is depends on what you find funny at either extreme.

MacFarlane’s sense of humor is at its best when it conflates innocence with the asinine. At the grocery store, Liam Neeson turns in an amusingly weird cameo as one of his brooding tough guys trying to buy a box of Trix. Neeson commits to the deviancy of buying something “for kids.” It’s random and very funny. But MacFarlane has always done situational randomness well. Take the Tom Brady scene from the trailer: Before Ted asks John for his sperm, they break into Brady’s bedroom to steal his, and MacFarlane has Ted show up dressed, prophylactically, as Paddington Bear.

But MacFarlane — writing once again with Wellesley Wild and Alec Sulkin — isn’t sophisticated or honest enough to unpack his sexual and racial fantasies and hangups. He just spews them. Ted becoming a person includes the acquiring of a surname. He chooses Clubber Lang, after the villain Mr. T played in Rocky III. Samantha’s full name turns out to be Sam L. Jackson, but she’s been too busy getting high and studying the law to know who that is. Either way, her cluelessness is the premise for a series of limp jokes predicated upon racial ignorance.

As a filmmaker, MacFarlane makes a show of how easy it is to assume a black affiliation and cherry-pick from black cultural and political history. America just rode a wave of speculation and revulsion over Rachel Dolezal, the white woman who’s been living for years as a black one. With MacFarlane, the appropriation is both too much and not enough. Dolezal has remained committed to her performance. She believes she is what she says she is. But MacFarlane doesn’t appear to believe in anything. He just likes to mess around with things that still have value without seeming to get whether that value is greater than his jokes. It’s as if he doesn’t really know what he’s laughing at or care what race and sexuality and gender are. It’s as if he doesn’t know women or black people — just white comedy writers who love to make fun of them.

For some reason, the movie has Ted and John watch LeVar Burton as Kunta Kinte receiving a whipping in Roots for refusing to accept his American plantation name. Ted’s gleeful embrace of the Clubber Lang name mocks that determination. “That’s just like me,” he says of Burton’s character. I suppose it could have been, with a satirist capable of or interested in taking that kind of ridiculousness as far as it can go. There’s plenty of Roots comedy out there. It’s a miniseries, not a sacrosanct text. And MacFarlane is comedian enough to sense the musty camp that comes off this movie now. But MacFarlane’s joke in this scene is that Ted’s empathy is backward. It’s not the whipped he should be identifying with. It’s the whipper.

MacFarlane doesn’t have a measuring stick long enough to take in the incongruity between a beaten black body and his teddy bear’s narcissism. His tolerant intolerance is lazy and incurious. The black characters are all movie-servant class — Dennis Haysbert might be a doctor, Ron Canada might be a judge, but it’s in the same way that Morgan Freeman’s a lawyer. In the movies, these are menial jobs for women and people of color, spending their slivers of screen time handing out advice, bits of plot, and verdicts. And add to that the scene where the cashier, Joy, demonstrates Ted and Tami-Lynn’s fitness for parenthood by pointing to a nonblack couple cooing over a baby as “those white n—–s.” Twice. That sort of comedy veers into territory beyond MacFarlane’s understanding. He’s included that line from Joy as a defense against anything on tap for later. He might have equated this teddy bear with oppressed black people who once were legally three-fifths a person. But he never called anybody the n-word.

This is probably not the moment for Ted 2, a time when a young white man can sit among a group of black Charleston churchgoers for the better part of an hour before taking out his weapon and shooting nine of them dead; one in which the ensuing conversation focuses on whether the cause was racism and why we have to keep going there even after it’s been demonstrated that the shooter was well steeped in white-supremacist concerns. It’s one in which the president can come under fire for saying the n-word as though he were using it the way Joy does in MacFarlane’s movie; and one in which the cross-racial outrage over the racist flag that waves on the South Carolina capitol lawn reached such a political pitch that, for the first time, there’s actually a possibility that it could be removed.

In one sense MacFarlane is just making dick and personhood jokes in a commercial comedy that is gleefully marketed to all. But for the people who own those penises, who rarely, in American movies, experience equal personhood, this can sting. That, of course, isn’t all. Part of the Charleston shooter’s pre-massacre statement apparently expressed contempt for black sexuality (“You rape our women”). That contempt is almost as old as this country. But its expression from a 21-year-old unemployed landscaper and a very popular 41-year-old entertainer would seem to suggest that it’s not going anywhere soon.

For people of color, some aspect of friendship with white people involves an awareness that you could be dropped through a trapdoor of racism at any moment, by a slip of the tongue, or at a campus party, or in a legislative campaign. But it’s not always anticipated. You don’t expect the young white man who’s been seated alongside you in a house of worship to take your life because you’re black. Nor do you expect that a movie about an obscene teddy bear would invoke a sexual stereotype forced upon you the way Kunta Kinte was forced to become “Toby.” MacFarlane goes a step further, daring to commit a defensive racial consecration along the way. When Ted and John lift the bedsheet over Tom Brady’s genitals, they’re bathed in the same golden light that shined from whatever’s in that briefcase in Pulp Fiction. Calling Brady’s junk holy would be funnier if this movie weren’t simultaneously implying that Cam Newton’s is scary. MacFarlane’s insecurity is what it is: his. But in that fertility clinic, he has aimed some of that sense of inadequacy at a multiracial family with diverse sexualities that, unthinkably, through its very public existence, has come to represent revolutionary love, compassion, and social imagination. So to see Wahlberg wailing in a pool of semen is to recognize a great truth that still appalls disparate pockets of this country: We’re all Kardashians now.