While many people in the one piece world view Luffy as a hero, to a majority of the world, he is one of the worst pirates who has ever lived. Just as Shanks and Roger were before him.
This isn't something I think is going to change, nor should it. While Luffy's actions are heroic, he ultimately takes on the role of a villain within the world he lives in. That is simply the life of a pirate.
This is something Luffy has done over and over again. Look at when he punched Koby in order for him to be accepted into the marines, or when he pretended to steal the treasure in order to protect Gaimon's feelings, or when he supposedly "kidnapped" rebecca at the end of Dressrosa.
Something similar has to happen at the finale of the series. While Luffy is the hero the world deserves, Koby is the hero the world needs. As we know, the celestial dragons are hated by many outside mariejois. We saw what happened even to good celestial dragons like Homing when they were left without WG protection. When the celestial dragons are removed from power, what is going to stop the people from genociding them, as I'm sure a majority of them would love to do?
I think Luffy will save the celestial dragons and in doing so, create world peace. He will do this by taking the role of a villain and sitting on the empty throne, proclaiming himself as king of the world. In doing this, Luffy will reach greater levels of Infamy than either Xebec or Roger. He will be the greatest pirate to have ever existed.
In doing this, Luffy will direct the anger of the world away from the celestial dragons and onto himself. Koby will engage in a fake battle with Luffy in which Luffy throws the fight, making Koby the greatest marine and hero of the world. Oda will probably reveal that Koby has celestial dragon heritage, making the world drop their hatred of CDs. And that will be it.
Luffy ends the story as the most infamous pirate, as he always dreamed; Koby ends the story as the greatest hero, as he always dreamed.