Maybe you missed the part where Dobby was freed and he was very happy to be free. Winky had Stockholm syndrome, she relied entirely on het master, and most of the houseelves are like her. The message is not that slaves should never be freed but rather that you have to consider their interests and wished as well.