Whitebeard was never Luffy's enemy. Luffy never even made a goal to defeat WB. Imu is not WB; he represents everything that Luffy and even Teach hate. Luffy and Teach are from the D. clan, and Imu is from the gods' clan. Imu committed so many crimes that only Freeza from DBZ can be compared to him. And we know about him only tip from the icebearg.
More to this, Imu is already nerfed, but still, there's basically no one in SH who can stay and fight against him. This is the way Oda introduces the idea of the Final Fight against Imu. Right now, he is weakened, but in the Final Fight, he will be absolutely broken. If Teach by some crazy move will be able to absorb him, I'm putting money on it, Imu will return eventually.
Plus to this, Imu's fruit is too complex for Teach to even release its full potential. Teach wouldn't be able to show the full potential of Gura Gura fruit, or Yami Yami. Oda will never do something like killing the biggest enemy of D. clan by coincidence, without showing a real full force fight.