Idk I feel that it could be a similar to how Luffy teamed up with crocodile despite there different goals because
- Obviously Ivankov
- He was confident in his own strength to be able to put him down worse case scenario
- They share a similar greater enemy
Doflamingo has his own New World allies from the New World, so it's pointless... And stupid for Oda to do that.

