There are a few laughs in Seth MacFarlane’s sequel to his 2012 hit about a foul-mouthed teddy bear come to life and his dim-bulb human buddy. But you won’t need more than the fingers on your hands to count them—a quick dig at uniformity of opinion among bloviators on Fox News, a cameo in which Liam Neeson frets over a box of cereal, a goofy mention of Filene’s, some woefully inappropriate audience suggestions at an Improv club, a gag involving candy on a desk…okay, maybe one hand is enough. Most of “Ted 2” is just a juvenile stream of drug gags, penis-centric jokes, pop culture riffs, and other raunchy stuff ladled out with a sluggish, leaden hand, occasionally punctuated by musical numbers, of all things. And the fact that it tries to deliver a message about accepting those different from yourself makes it all the more cringe-worthy.

The movie opens with Ted wedding Tami Lynn (Jessica Barth), his brassy co-worker at the super market, with the ceremony conducted by repeating guest star Sam J. Jones, aka Flash Gordon. Long-time roomie John (Mark Wahlberg) serves as best man, though his own marriage to Lori (Mila Kunis), which closed the first installment, has—we’re told—ended in divorce (a rather dreary way to explain Kunis’ absence here). But despite the hopeful festivities, the marriage is soon on the rocks, with Ted and Tami Lynn hurling insults at each other like characters from “A Streetcar Named Desire.” Ted’s advised by garrulous co-worker Joy (Cocoa Brown) that the only way to make things right is to add a baby to the mix.

That makes sense to Ted, but his lack of the necessary equipment means that a sperm donor must be recruited. After Jones declines, Ted and John make a futile attempt to secure a donation surreptitiously from Tom Brady, who makes a game but unfunny appearance as himself (he really shouldn’t give up his day job for acting), before agreeing that John would be the ideal choice. That leads to predictably tasteless turmoil at a sperm bank before it’s revealed that Tami Lynn can’t bear children anyway—which, of course, leads to a decision to adopt.

Setting aside the fact that Ted and Tami Lynn would be absolutely terrible candidates as adoptive parents, the script segues instead to a legal problem—that the state classifies Ted not as a person, but as property, ending his employment as well as his marriage. That introduces what becomes the movie’s major plot pivot—a supposedly Capra-esque court battle to prove that Ted’s as human as anybody else. It in turn leads to the hiring of a pretty, just-minted lawyer named Samantha L. Jackson (Amanda Seyfried)—the character name naturally supplying a stream of snarky references that she, totally unacquainted with pop culture, doesn’t get—who becomes John’s new romantic interest. It also introduces a dismal subplot in which Donny (Giovanni Ribisi), the villain of the first movie, reappears as a janitor at the Hasbro toy company, who convinces the firm’s head (John Carroll Lynch) that if they ensure that Ted loses, they can tear him open, find out how he works, and produce millions of copies of him for sale. Cue two more lawyers, sleazy Shep Wild (John Slattery) for the state and civil-rights champion Patrick Meighan (Morgan Freeman), to enter the fray.

The legal proceedings are reduced by MacFarlane to the simple proposition of equal treatment for all beings that possess the basic intellectual and emotional functions of humans. Where his script descends into serious crudity is the fashion in which such high-minded notions are presented in terms that merely reinforce the casual language of bigotry. The practice isn’t employed with regard to the civil-rights struggle of blacks, of course; that would be socially unacceptable (though the characterizations of Joy and the judge played by Ron Canada have a strong streak of stereotyping). But it’s trotted out in full force with respect to gay rights. When Ted draws a comparison between his courtroom battle and that struggle, he happily refers to those he’s aligning himself with as “fags,” and when reprimanded for his insensitivity, happily uses “homos” instead. You might say that MacFarlane is just employing the old Norman Lear tactic, turning Ted into a sort of furry Archie Bunker. But the result comes across less as well-meaning social commentary than as just more thoughtlessly frat-boy humor.

But whether or not one takes offense at such matters, the other parts of the ramshackle script rarely rise above the feeblest forms of puerility. A long sequence at Comic Con falls flat, relying way too much on the knockabout figures of returnee Guy (Patrick Warburton) and his partner Rick (Michael Dorn). The appearance of bongs at every conceivable opportunity grows tiresome, even when unusually-shaped ones are introduced. The cameos are mostly inconsequential, except for Brady’s and a brief one by Jay Leno, which the former late-night host should certainly regret. A “Breakfast Club”-inspired montage is, like so much else here, merely an extraneous bit tossed into the mix to make viewers think how clever they are for recognizing the source. And the musical bits that MacFarlane, who loves to sing, has seeded throughout rarely work: though a sing-along to the “Law and Order” theme is mildly amusing, a gag satirizing the way Disney pictures used to have cute little animals amble out to listen to songs is pretty musty by now, and goes on too long. And the elaborate opening, which has a tuxedoed Ted and a similarly-clothed chorus line dancing in the Busby Berkeley routine on a gigantic wedding cake, is technically impressive but does drag on.

That lack of pace afflicts the entire movie. MacFarlane, as “A Million Ways to Die in the West” proved, is not an adept director. Most of the scenes are rather clumsily choreographed (witness the Comic Con fights) and tend to lumber along; one might be inclined to blame editor Jeff Freeman and cinematographer Michael Barrett, but it would seem that the fault really lies in the way MacFarlane chooses to stage sequences and have them play out. On the other hand, his voicing of Ted is fine, reflecting the character’s saucy persona, and Wahlberg once again plays an amiable doofus with a degree of charming self-deprecation. But Seyfried, while obviously eager, doesn’t register much beyond generic attractiveness, Freeman seems slightly out-of-sorts at being in his scenes at all, and Warburton’s shtick, as usual, is disagreeably overbearing. Barth and Ribisi do what’s asked of them, which is, respectively, to bray and to radiate creepiness.

“Ted 2” unabashedly appeals to the same adolescent male mentality that made the original a surprise smash, and its cascade of crassness, while leavened with some supposedly serious notes, will undoubtedly score with its target audience. There are others, however, who will find this second helping of MacFarlane’s smugly lowbrow hijinks well-nigh unbearable.