If you're referring to slavery as it was back in the 17th and 18th centuries, people had slaves because it was a normal thing that a lot of farmers and sometimes people did. Nobody stopped to consider the moral aspects of slavery and the using of an innocent being as a tool was a common occurrence.
If you're just talking in general, somebody may treat another person unfairly to feel powerful or better than the other. I am sure it makes some people feel good to boss other people around.