Since one of the aspects of wrong livelihood is human trafficking, why do we frequently read in the Canon instances where a slave should be good to his master, a master should be good to his slaves.
In Vanijjā Sutta it is said a lay follower should not engage in 5 types of trades which include Trading in humans (satta vaṇijjā). Some forms of slavery is still persist today.
Trading in humans. Although slavery has been officially or effectively banned and ended in almost every nation, various forms of slavery still exist. The most common kinds of disguised slavery include child labour, forced labour, forced prostitution, and the selling and buying of children and adults. Children should be schooling until they are old and mature enough to work gainfully. No one should be forced to work against their will or without proper health considerations, contract or remuneration. All workers and employees should be properly treated.
Prostitution is wrong simply because the person is treated and exploited in a physical sense. Even if they are paid for their services, the liaisons are rooted in lust, which is an unwholesome root as they are treated as mere objects of pleasure.
The negative implications are greater if the perpetrator is married, as this means disloyalty to the spouse and a bad example to their children, who are likely to repeat the vicious cycle. There are also the grave dangers of sexually-transmitted diseases. However, we should not be too quick to blame the prostitutes themselves, because they are usually the victims of abuse, poverty or social problems. The roots of the problem should be addressed in order to help them rise above their unwholesome circumstances to live dignified lives.
Buying and selling of children is a form of slavery as they often end up in forced labour, prostitution, abuse and other unhappy circumstances. Buddhism, however, is not against legal and proper adoption of children. In difficult circumstances, such as the children being abused or becoming orphans, they should be given proper care, protection (such as becoming wards of the state), and education.
It was common to have slaves in India at the time. Not too long ago there were prominent US presidents also who owned slaves and also a civil war over slavery. This again was a cultural norm than do with Buddhism. The Buddha also might have seen at that time any radical change might have not been possible, hence resorted to saying being good to slaves as this will have a wider and practical impact. If you look at the Sutta on the layman's precepts early Suttas did not have any reference to taking intoxicated. This was before all the major kings and tycoons were his disciples and it was acceptable in the higher classes to have a small drink. Introducing this prematurely would have put off possibly some people from the Dhamma. But once established and society and Kings and tycoons became receptive, the Buddha did bring in the 5th precept. (E.g. Sigalovada Sutta only has the 4.) Likewise saying no to slavery may have triggered a reaction something akin to the US Civil on weighing the benefits of such against spreading the benefits of the Dhamma he would have thought saying be good to your slaves would resulted in overall maximising benefit to slaves and society at large. Even prominent disciples like Anathapindika, Visakha owned slaves but when the masters were receptive to the Dhamma and they got established they became good towards others including their slaves, the benefits flowed to the slaves also.
Some advice Vishaka was given from her father, also a follower of the Dhamma, included:
Before taking her food, a wife should first see that her parents-in-law and husband are served. She should also make sure that his servants are well cared for.
Before going to sleep, a wife should see that all doors are closed, furniture is safe, servants have performed their duties, and that parents-in-law have retired. As a rule, a wife should rise early in the morning and unless she is sick, she should not sleep during the day.
By mentioning something not in tune to the times and culture present those days would have made people less receptive to the Dhamma and would have reduced the benefits the slaves and society would have potentially got. There are accounts that both male and female slaves have also benefited from the Dhamma.
Also if the trade of slaves is discouraged so does the ability for one to acquire and build a large base of slaves.
I think you are mistaking servant for slave.
In five ways should a master minister to his servants and employees
(i) by assigning them work according to their ability,
(ii) by supplying them with food and with wages,
(iii) by tending them in sickness,
(iv) by sharing with them any delicacies,
(v) by granting them leave.
This neither fits the description of a master-slave relationship nor does it involve any human trafficking. Therefore, it doesn't come under wrong livelihood.
human trafficking is not the same as slave employment or exploitation
i think Dhammic view at this practice could be likened to the Dhammic view upon meat consumption: if a person wasn't provided as a slave specifically to another person, the slave buyer or owner doesn't incur fault
i'm speaking from the point of view of a person accustomed to slavery as a norm, personally i don't advocate or justify it
according to the commentary on Vinaya the Theravadin orthodox view on slavery is of acceptance as a fact of life
assistance a slave in escape from the master without mitigating factors is regarded as theft, a grave, parajika, offense, which invariably results in the offender's expulsion with no right to re-join the Sangha in the remaining lifetime
("The Buddhist Monastic Code, Pt 1" by Ven Thanissaro Bhikkhu, p.70)