For the person who keeps harping on about slavery in Harry Potter - Hermione's elf-rights group is called SPEW (Society for the Promotion of Elfish Welfare) which (and in no way accidentally) shares an acronym with real life SPEW (society for promoting employment for women).
Yes one can read "House elves are slaves" and stop thinking there. But they are actually based on mythological brownies (creatures who will do housework for humans in secret but get very offended and vengeful if you try and pay them) and are being used as an allegory for... house wives and a lack of women's rights.
Dobby is the battered and abused wife who escapes and becomes a feminist. Winky is the divorced / abandoned wife who turns to drink to deal with the societal shame put on her for her "failure". Kreacher is a trad wife, clinging to the benefits he receives by going along with the status quo regardless of how awful the people with power over him may be. House elves are offended when Hermione wants them to be paid because they are part of the family and they are doing this for love, same as house wives don't expect payment for their labour.
And they have absolutely been brainwashed into thinking this is what their purpose is and this is what makes them happy, and it has been going on for so long that no one knows where it started, no one even sees the unfairness and it is simply accepted as "the way things are".
Hermione - as the female lead of the story - is not locked in a battle to free the slaves, she is locked in a pseudo battle for women's rights. And she finds herself banging against the twin barriers of a) all the humans laughing at her (even the nice ones) and telling her this is the way it's supposed to be, it's "unkind" to the elves to change things and refusing to take her seriously because the oppression runs so deep they simply cannot see it and b) fighting for a people who themselves are resisting what she is offering because they believe themselves to be happy and in their rightful place.
Both these problems have been encountered by nascent women's rights organisations the world over. Hagrid refuses to listen to Hermione - he is the man who is perfectly lovely but just doesn't get it; we've all met them. He sees what he wants to see, he benefits from the system, it doesn't affect him negatively in any way and so he is happy not to think about it further and dismisses change as against the natural order. And the elves are like the women who argued and stood against the suffragettes. They don't want or need rights because they feel the system works for them as it is. It is only the Dobbys - who are cruelly abused - that seem to get that things are wrong, and even he can't overcome all of his conditioning (the way women can't let go of their guilt when they try to stand their ground and don't put everybody else before themselves).
Hermione is having to navigate a lack of support from all sides, and outright hostility form the very people she is trying to help, just as early feminists did (and later ones still do). And she's a headstrong teenager, she doesn't get her activism right. But she slowly convinces other young people that the status quo is not OK - culminating in Ron's suddenly thinking of the House Elves in the middle of the Battle of Hogwarts. And Dumbledore is supportive of her and backs her belief in fair treatment of Elves and both he and Hermione criticise Sirius and lay the blame for Sirius's death not on Kreacher but on Sirius's treatment of Kreacher.
The Black family are interesting, because Kreacher is loyal to the bad Blacks while hating the good one - and from Harry's perspective this is originally framed as Kreacher being a "bad" elf in direct contrast to Dobby who was a "good" elf. But the difference between them isn't their moral compass, it is their treatment by their families. Dobby is abused by the Malfoys and so hates them and betrays them and, as the Malfoys are bad, Dobby does things that help our protagonist and thus are "morally good". Kreacher has been well treated by the majority of the Black family but is mistreated by Sirius, and so hates him and betrays him. Because Sirius is a good character this frames Kreacher as being morally wrong. But both Elves are responding to their abuse in the same way (betraying their abuser and helping their enemies), and it is the wider politics of the owners and not actually the Elves' actions that determine whether the Elves themselves are seen as "good" or "bad".
And this is eventually realised and acknowledged by Harry himself. When Dumbledore suggests that Sirius's treatment of Kreacher was not all that it could be back in ootp Harry gets very angry. But in DH when Hermione says "I always said Wizards would pay for how they treated House Elves - well, Sirius did..." he understands what she means and does not attempt to defend Sirius; he understands the difference in the way the Black brothers treated their elf and how this shaped Kreacher and determined his actions.
Regulus Black is the man who publicly espouses awful views, is a far right bigot - but who treats his "wife" well and seems to genuinely care. Thus Kreacher loves Regulus and echoes his beliefs. Sirius is the right on, lefty, liberal man who says all the right things in public but goes home and beats up his own "wife". And so Kreacher hates him and conspires against him.
The lack of agency the Elves have and the way they view the world through the prism of their treatment by the wizards directly in charge of them echoes the lack of agency women have had throughout history - when denied education and a vote and a voice and even the right to own property, they could only effect change through the men in their lives - and the change they affected would be dependent on who those men were and how they treated the women.
And as to why it's not all sorted and solved by the end of the book. Well, take a fucking good look around at the state of women's rights in the world today, genius. The fight isn't over. The war isn't won. Women are still oppressed (and now JKR is fighting a massive rearguard action on the biggest assault on women's rights and attempts to take us backwards that has happened in her life time). Of course Hermione did not solve the problem in the three years she had between identifying it and the series finishing.
But even if you want to go with the surface level (and frankly amero-centric) slavery interpretation. That wasn't fixed in three years either. To expect a teenager to fix centuries of slavery in four books is frankly ludicrous, and to criticise the books for not tying it all up in a neat bow is just stupid.
The House Elf story line is a sub plot which serves to show us, the reader, and Harry as the main character, that the wizarding world is not the fuzzy friendly, whimsical refuge from the Dursleys that he (and we) originally viewed it as. It isn't a bunch of good guys and this one bad wizard who can be defeated by love, it's much darker, with systemic oppression and injustices that even the good characters fall prey to and can't see. There is corruption in government, there is lazy thinking and actual rotten sentiment that allows Voldemort to operate. And yes - they successfully take down Voldemort - but the rest of it is a bit more complex and it is going to take a bit more than a wizard's duel to put it right. The books itself don't have room to go into the complete reconstruction of magical government (not really appropriate for a children's story) but the later writings of what the characters do with their lives and in their careers show us that they did work towards making things better and Hermione got much further in helping the House Elves once she was in the Ministry than she did as a teenager.
Just because you do not understand the House Elf subplot does not make JKR problematic.