TLDR: Blackbeard's ancestor Sad Man/Moon was jealous, and betrayed Joy Boy/Sun. Sad Man used his Darkness powers to Eclipse Joy Boy's powers, allowing Im/Uranus and the Gorosei to defeat Joy Boy, and replace him as "Gods". Sad Man was then betrayed by Imu, and Rocks/Blackbeard want to get revenge on the World Government for denying them the God-hood they were promised.
Blackbeard is controlled by Sad Man, and Luffy will defeat Sad Man in order to free Blackbeard from his Ancestor's sins, making Blackbeard become Marshall D. Teach. The D clan, the Dawn tribe, will reunite, Joy Boy will forgive Sad Man for his betrayal, and they will stand together to defeat the false Gods who caused the Eclipse that created the Void Century: the century void of light.
The recent astrological/astronomical focus in One Piece made me realize (like many others) that if Luffy is the Sun, Blackbeard is most likely the Moon. While it's possible Imu could be the moon, since Imu seems to be connected to the Ancient Weapon Uranus, it's much more likely Imu serves as Uranus, with Shirahoshi being Neptune, and Momo being Pluto.
So, let's say Blackbeard is the Moon, and Luffy is the Sun. This sets up their rivalry perfectly, and explains everything: the Moon eclipses the Sun. In some mythology, this is because the Moon WAS JEALOUS of the Sun's light, and wished for people to only look upon it. The Moon can only shine through the Sun's light, after all. Without the Sun, it is what? Darkness.
Before The Dawn, there was The Eclipse. This is how Imu and the WG gained power: the Sun was weakened/Eclipsed, by the Moon, making it so the rest of the planets (Imu + the Gorosei + the Ancient Weapons possibly) could overtake the Sun.
Blackbeard's Ancestor (I'll call him... Sad Man...) was jealous of Joy Boy, and his great power, even while working alongside him. He knew he could never shine as bright as the Sun, Joy Boy. Imu, seeing this jealousy, convinced Sad Man to betray Joy Boy, and offered him great power. However, Sad Man, after betraying Joy Boy, was also betrayed: Imu, knowing Sad Man could not be trusted, destroyed him as well.
That is the sin of Rocks' and Teach's bloodline, and why they wish to destroy the World Government: because they were betrayed by those they betrayed for. Rocks wanted to become King of the World, BECAUSE THAT'S WHAT WAS STOLEN FROM HIS FAMILY. Uranus/Imu promised Moon/Sad Man a place at the Gorosei's table, or, maybe, even an equal partnership. So, Sad Man used his powers of Darkness to "Eclipse" the Sun, Joy Boy, and his powers.
This is why the Final War is inevitable (Doflamingo is probably aware of a lot of this): Blackbeard's family is always going to want blood, for how they were betrayed, while the Ancient Kingdom/Joy Boy side wants to bring about the Dawn, leading to a three way between Uranus/Imu and the Planets/Gorosei, the Sun/Joy Boy, the Moon/Sad Man, with the Ancient Weapons being used as pieces to fight.
This betrayal with Blackeard also ties directly back to Orochi in Wano. Orochi couldn't shine as bright as Oden, so, he eclipsed him. But, no matter how much he tried, Orochi could only shine by stealing Oden's light: even Orcohi's own propaganda involved him using Oden's Two Sword Style. Eventually, Orochi was betrayed by the man he betrayed Oden with: Kaido. So, then, Orochi tried to backstab Kaido as well with the fire. This has all happened before.
However, AND THIS IS VERY IMPORTANT, Luffy will break the cycle, BY REDEEMING BLACKBEARD and making him an ally. Luffy is the one who STOPS these cycles of revenge and violence. Luffy freed Wano, by making a Kurozumi like Tama befriend a Kozuki like Momo, by making Yamato accepted as a defender of Wano, rather than hated as Kaido's child.
Nothing will change if Luffy tries to kill Blackbeard, once realizing why he is the way he is (I fully expect Rocks/Sad Man to also be controlling Blackbeard on some level). Luffy has to beat Rocks/Sad Man, to SAVE Blackbeard from that fate. That is why Blackbeard cries when he looks at the moon. It's not only his home on some level probably, connected to the Ancient Kingdom, but he is cursed to always be Eclipsed by not only Joy Boy, but his own Ancestors' sins.
Luffy will free Blackbeard from his past: and he, instead, will become Marshall D. Teach, the man who will overcome his Ancestor's betrayal, and help Joy Boy, the King of the Pirates, defeat Imu, Uranus, the false God who Eclipsed the Sun during the Void Century: the century void of light. The century of darkness. The century where the Sun was killed, and replaced.
The Dawn will only come when the clan of D(awn) reunites. When the Sun and Moon are in harmony again.
(One more fun fact: the reason the astronomical model of the solar system in the Library of Ohara is revolving around the planet they live on, not the sun, is because the sun is not viewed as the center of the solar system, the earth is. The WG doesn't want people thinking the world revolves around the sun, the Celestial Dragons want the world to believe that everything revolves around them, LOL)