As a rude, crude, slapdash one-liner, the boy-and-his-toy comedy “Ted” was the surprise hit of 2012, earning more than half a billion dollars, most of it abroad, and proving that all a movie needs is a vulgar talking Teddy bear, weed jokes and some naughty sight gags to teach the world to laugh, if not sing, in perfect harmony.

With “Ted 2,” director and co-writer Seth MacFarlane — who also voices the Boston-accented, profanity-spewing plushie of the title — tries to re-bottle that lightning, making a halfhearted bid for humanistic respectability in the bargain. As “Ted 2” opens, Ted is marrying his sweetie from the first film, Tami-Lynn (Jessica Barth). One year later, they’re bickering about bills and throwing epithets at each other. Advised that a baby would cure all their marital woes, Ted and Tami-Lynn decide to expand their family, an ad­ven­ture that stops short when they’re informed that, in the eyes of the Commonwealth of Massachusetts, Ted is not legally a person, but property.

As with the first movie, the novelty of “Ted 2” lies in the hostile, puerile, graphically gross verbiage that spews out of the mouth of the otherwise cuddly protagonist, as well as the copious amounts of dope that flow into it. And, as in the first movie, those novelties fade quickly. What are clearly manufactured to be the movie’s most memorable set pieces — a scene at a sperm bank where Ted and his human friend John (Mark Wahlberg) run gloppily amok; a random rendition of the “Law & Order” theme song they sing together while doing bong hits on John’s couch; and a sequence where a stoned Ted drives a car into a barn on a pot farm — are executed with more of a sense of duty than genuine, antic inspiration. As he proved with his misbegotten “A Million Ways to Die in the West,” MacFarlane is essentially a guy who’s gotten appallingly lucky on television. He exhibits zero proficiency in cinematic staging and no sense of pace.

The coarseness and monotony of politically incorrect jokes wear the viewer down. At one point Ted goes to an improv comedy club to yell out such tasteless prompts as “9/11,” “Robin Williams” and “Charlie Hebdo.” Yet moments of disarming sweetness sneak through. “Ted 2” begins with a smashing opening musical number that recalls Busby Berkeley, and Amanda Seyfried — who plays a young attorney helping Ted in his quest for justice — sings a lovely original song MacFarlane wrote for the film, during which creatures from the animal kingdom harken to her voice in Disney-fied adoration.

"Ted 2," the sequel to Seth MacFarlane's 2012 film "Ted," stars MacFarlane as the title character, along with Mark Wahlberg and Amanda Seyfried. The film is scheduled to be released on June 26. (Universal Pictures)

As ever, Wahlberg nails his portrayal of a man-child who’s still devoted to his best “thunder buddy,” and the throwaway lines he delivers with utter sincerity — about everything from Tom Brady’s manhood to “Beetlejuice” — are among the film’s funniest. (Brady, by the way, delivers one of several cameos in “Ted 2,” which reaches “Entourage” proportions. One scene in particular, set in the store where Ted and Tami-Lynn work, is a mini-showcase of deadpan lunacy.)

Between wordy courtroom fights and a climactic donnybrook at the New York Comic Con, great swaths of “Ted 2” sag into a punchy, sluggishly overlong assemblage of stunts and calculated provocation. In setting Ted on a quest for recognition of his rights and his love for Tami-Lynn, MacFarlane clearly means to address America’s freighted history with slavery, as well as the issue of marriage equality. Despite this dubious bid for respectability, the filmmaker doesn’t come across as enlightened, but rather as someone having his cake and greedily eating it, too.

It takes a particularly glib, entitled form of chutzpah to invoke Dred Scott, the 13th Amendment and the Emancipation Proclamation on behalf of a character beloved for spewing dim-witted epithets. Whether his intentions are innocent or ham-handedly cynical, MacFarlane — the man who gave us the song “We Saw Your Boobs” at the 2013 Oscars, and who lards his film with running jokes about gay sex and the physical endowment of African American men — has made “Ted 2” less a spirited defense of tolerance and equality than a facile, only fitfully funny burlesque.

R. At area theaters. Contains crude sexual content, perfasive profanity and drug use. 115 minutes.