Hawking had kept Danzo around in order to lure Sasuke back to Konoha.
If he remembered correctly, while Jiraiya infiltrated the Rain Hidden Village, Sasuke and Itachi had also fought a life-or-death battle at the Uchiha Clan's secret base.
With Itachi, his Older Brother, holding back in every possible way, Sasuke not only eliminated the hidden threat of Orochimaru within his body but also claimed the final victory.
However, before he could recover from the complicated emotions of killing his Older Brother, Obito appeared and told him part of the truth behind the Uchiha Clan massacre, causing him to shift all his hatred onto Konoha and Danzo.
After Obito's round of manipulation, Sasuke decided to join Akatsuki, help them collect the tailed beasts, and look for an opportunity to take revenge.
In the original plot, Danzo went to the Five Kage Summit and Sasuke intercepted him. Now, however, Danzo had been imprisoned in Konoha because of Hawking.
That meant Sasuke would sooner or later come to Konoha to seek revenge on Danzo, and Hawking only had to wait for the rabbit by the tree stump.
As for why he wanted to lure Sasuke back to the village, it naturally was not to help Naruto. He wanted Indra's Chakra, and Sasuke was Indra's reincarnation.
Madara Uchiha had transplanted Hashirama Cells from Asura's reincarnation, thereby awakening the Rinnegan.
He now possessed the same body of Asura's reincarnation as Naruto. Perhaps as long as he obtained Sasuke's Mangekyo Sharingan, he could acquire Indra's Chakra and awaken his own Rinnegan as well.
Even if that was not the case, Sasuke, as Indra's reincarnation, would undoubtedly be essential to researching how to awaken his own Rinnegan in the future.
After Hawking left, Jiraiya said to Tsunade, "Some of what Danzo said does make sense. Akatsuki