What was Ham's sin, and why did Noah curse Canaan?
In Genesis 9, Noah plants a vineyard, gets drunk and lies uncovered in his tent. Ham "saw the nakedness of his father" and told his brothers, who covered their father walking backward. When Noah wakes, he curses Canaan, Ham's son, not Ham himself. The text does not say why, and interpreters have argued since antiquity about what exactly Ham did.
Some readings take the sin to be simply disrespect: instead of covering his father, Ham exposed his shame. Others, from the phrase "see the nakedness", which in Leviticus 18 is a euphemism for sexual relations, imagined something worse, and the Talmud records rabbinic opinions along those lines.
The curse on Canaan is often read as a later explanation of the subjection of the Canaanites to Israel.
The Book of Jubilees (chapter 7) tells the scene nearly the same way and adds what came after: Ham is displeased that his father cursed his youngest son, leaves Noah with his sons Cush, Mizraim, Put and Canaan, and builds a city. Later, Canaan seizes by force a land that had fallen to Shem.
In the 17th to 19th centuries the so-called "curse of Ham" was used to justify the enslavement of Africans. That reading has no basis in the text, which curses Canaan and says nothing about skin colour, and the churches have rejected it.