Wouldn't it be better for them to just function like the various folkore creatures they're based on?

Free agents who live in people's houses and do household chores in exchange for respect and some sort of food offering. When mistreated they make the house owner's life a misery and/or leave and find a new house. Slavery issue is gone.

If you still want to have Dobby's arc then have him be enchanted to force obedience despite maltreatment, and have such enchantments be outlawed by the end of the story.