And they were explicitly non-human with a mindset which made them want to be slaves to their betters, because that was The Way Things Worked. Winky even had the stereotype of saying "is" instead of "am" or "are".The Hogwarts castle House Elves were really well taken care of and protected from abuse so they did't want to go anywhere else because like everyone who lived at the castle said " There is no place like Hogwarts" so they loved their home too and were willing to give their lives to defend it.
Putting aside other issues with Rowling, that there isn't great. Not saying we should burn her books because of it, or even that it was intentional, but that maybe the editor could have pointed out that there's an issue there.