Exodus Chapter 21:20
(20) If a man shall strike his slave or his maidservant with the rod and he shall die under his hand, he shall surely be avenged. (21) But if he will survive for a day or two, he shall not be avenged, for he is his property.
As previously mentioned, the Torah recognizes that slavery is an economic reality. We don't live in a fantasy world, and the Torah is very reality-oriented.
Economic reality aside, God created ALL human beings in His image, and ALL human beings are equal in God's eyes. We are prohibited from abusing ANY of God's creations, least of all our fellow human beings who are created in God's Own image.
Therefore, the Torah does not command people to hit their slaves, nor does the Torah encourage gratuitous hitting of slaves (masochism is antithetical to Torah). Hitting a slave is not the ideal situation. Now, it may be a necessary reality, given human nature (just as children sometimes require discipline). But it is not ideal.
That is why this law begins "IF" a man strikes his slave - not a man "SHOULD" hit his slave.