Revenge.
I'm convinced that the Celestial Dragons are probably the original slave race of this world.
Take another look at the Chapter 1138 Mural. If you count, there are 19 "slaves" harvesting "sparks" from the underground in order to power the city. This lines up pretty well with the 20 Kings who would eventually go on to form the World Government. I think that these slaves were helped by the original Nika in order to overthrow their masters and finally be free...only to take over and eventually become just as bad as the people who originally enslaved them. Absolute power corrupts absolutely.
So, the slaves would be a way to "punish" the people who originally wronged them. And then, over the centuries, it expanded to other types of criminals. And then it expanded again to include anyone they liked, because by that point they've become completely corrupt. It was probably a slow, gradual change from "rehabilitation" to "convenience" for the Celestial Dragons.
Or it could go another way.
Most Celestial Dragons wear a bubble helmet. At the current time, they say it's because they don't want to breathe the filthy air of the commoners. But, what if it was originally the other way around?
What if all the Celestial Dragons originally had some sort of disease that they were trying to prevent spreading to everyone else by "quarantining" themselves inside their bubble suits? That could also be why they live all the way up on Mariejois. They're FAR away from everyone else, so they don't have to worry about spreading their disease to anyone else.
Over time, maybe future generations eventually developed an immunity to the disease. But by that time, wearing the bubble suits had become part of their culture. Kind of the reverse of Amber Lead poisoning from Law's hometown. Instead of the disease becoming stronger over time, it became weaker, perhaps, as the children started developing an immunity to it.
We know Ginny got Sapphire Scale after being around the Celestial Dragons. And that was supposed to be a old disease that no one's had for hundreds of years. And she got that right after being kidnapped by the Celestial Dragons. Now, that could be the result of Saturn's experiments, but we don't really have a clear timeframe of what happened when. It sounds to me like Ginny was "discarded" after she got sick and Saturn took her in, but it's unclear. This does seem to point to the idea that the Celestial Dragons could be carriers of some sort of ancient disease that they don't even remember anymore.
In this scenario, the slaves would have been originally necessary in order to take care of the sick. If the Celestial Dragons were originally a group of sick people, they might not have been able to take care of themselves on their own. They would have needed other people to take care of them. Most people would be understandably reluctant to risk catching the disease themselves. So, maybe Imu originally forced a group of people to help them, just so they wouldn't all die. Now, eventually, the disease subsided, but the Celestial Dragons got so used to being waited upon that they didn't want to give it up. Something that originally had a innocent, helpful purpose might have been twisted into something ugly, just by the passage of time.
Imu might be keeping the slave system going just because Imu's worried that the disease will eventually come back and threaten to kill the children of Imu's old "friends" from centuries ago. Imu might be protecting the Celestial Dragons because they are all that's left to remember Imu's old friends by.
One way or another, I am expecting the Celestial Dragons to end up with some tragic backstory. This is One Piece, after all. EVERYONE gets a tragic backstory. So, don't be surprised if the existence of slavery is "justified" in some way. I feel like that's going to put off a lot of people, but I do see Oda eventually going that way. The Celestial Dragon's origins will most likely be "sympathetic" in some way.