Excluding the verses that are unrelated to slavery, because we can get into how those are differentiated later, and slavery is a bit more of an important topic. As I said, slavery in and of itself is not bad, and in this context it was allowed to a certain people, at a certain time, against a certain people, in Leviticus. Keep in mind when it is said, "As for your male and female slaves whom you may have—you may acquire male and female slaves from the pagan nations that are around you."
These pagan nations were worshipping Moloch, and other satanic tier Gods, they were literally sacrificing their children, and other nations children, brutally in my cases, many of these people from these nations eventually came to be what was known later in the bible as "pharisees" who eventually became what we know as Ashkenazi Jews, these were not people who were bringing their best my any means, they were very nasty. I can't really view slavery as unjust in that context, or in certain other contexts aswell.
Again, slavery still exists, for example with prisoners, and forced labor. Slavery in and of itself is not a bad thing, in certain contexts.