Our father Jacob has 12 sons, from 4 wives. The only one he loves is Joseph, and that is why all the brothers hate Joseph. They try to kill him and end up (out of greed) selling him into slavery.
Why does the Torah tell us such a story? Why are our ancestors portrayed by the Torah as such terrible people?
The courage of the writers and editors of the Torah to send us a message that our ancestors were regular people, not saints, and that no one is perfect, sends a very strong message. We can identify with our ancestors, see ourselves with all our imperfections in them, and learn from their mistakes. Perfect people are boring and do not exist, our ancestors are fascinating.