I see nothing in the verse as to whether the slave deserved the beating or not. It merely says there is no penalty if I beat a slave and the slave lives. After all, it wouldn't be logical for me to diminish the value of my slave to myself if I injure him, now would it? So the slave has that protection.
Ex 21:20-21 If a man strikes his male or female slave with a rod and he dies at his hand, he shall be punished. If, however, he survives a day or two, no vengeance shall be taken; for he is his property.
NASU
This is an evil law. Slavery is evil. Beating without any punishment for the beating is evil. The law of God in the OT is a compromise between what God really wanted and what men would accept as law.