For a comedy that celebrates bad behavior, "Bad Teacher" isn't quite bad enough to be good.

For a comedy that celebrates bad behavior, "Bad Teacher" isn't quite bad enough to be good.

With a title that evokes "Bad Santa," which set the bar for hysterically abhorrent behavior, comparing the two is inevitable. "Teacher" is solidly R-rated but never quite goes too far, which for this sort of movie, isn't far enough.

Elizabeth Halsey (Cameron Diaz) is a shallow middle-school teacher far more interested in marrying into money than educating her students.

When her sugar daddy fiance abruptly breaks off their engagement, Elizabeth is forced to return to her teaching gig. Looking for a new rich man, she decides a breast augmentation is the way to augment her income.

While she's looking for creatively awful ways to swindle money for plastic surgery, handsome new teacher Scott Delacorte (Justin Timberlake) grabs her attention - particularly since his family is apparently loaded.

Meanwhile, Elizabeth rebuffs the advances of the school's gym teacher (Jason Segel), because, well, he's just a gym teacher.

"Bad Teacher" wants to be a black comedy, but it comes off in shades of gray. The elements are there, but they never quite combine in the right mix.

Director Jake Kasdan - who has made a couple of fine and underrated comedies in "Orange County" and "Walk Hard" - has a little trouble finding a groove.

The setup establishes Elizabeth to be shallow and unlikable, but she's still not the sort of self-absorbed sociopath that these comedies call for.

When the movie later finds its heart, it's disappointing that it wasn't built on a stronger foundation.

Diaz is trying to shake things up with this role, but she needs a lot of support to carry a comedy. Timberlake - who proves ever-funny as a "Saturday Night Live" host - is way too one-note with his nerdy nice-guy act, though the two share a hysterically uncomfortable sex scene.

The lovable Segal has moments that make you wish he was better utilized, and the breakout may be Lucy Punch as gratingly chipper rival teacher Amy Squirrel.

The elements are there, as are a fair share of laughs, but I still wish "Bad" had taken a turn for the worst.