I always compared Blackbeard as a rival to Luffy, rather than as a villain. They both hold very similar ideals, and Blackbeard seems to show a bit of respect to Luffy for it.

Pirates fight for their own beliefs, that's the way its always been. Doflamingo made the observation himself that the concept of good and evil is only defined by those who control the era.