Regarding the identity of the one whom Noah cursed, commentators suggest various solutions. For example, (a) the cursing of Canaan instead of Ham might have to do with the combining of traditions in which one story might have had Canaan as the transgressor, not Ham; or (b) the focus here is the narrator’s attempt to provide an origin story for Canaan as a nation that God opposes.
I think that there is something to that second suggestion, but one must keep in mind that the book is consistently occupied with generations / family lines. So for Noah to curse Canaan is to amplify his anger with Ham by cursing his lineage.
Why not curse all of Ham’s children then? As that second solution suggests, the narrator does like introducing key people in earlier episodes (the founders of Babylon and Canaan are given attention in Gen 9 and 10, and these are the two centres that are the focus of Abraham’s migration in Gen 11 and 12). Israel associated Canaanites with all sorts of immorality, and Genesis will revisit elements of this story in chapter 19 (Lot and Sodom), so this may serve to foreshadow Israel’s experiences with this line of Ham’s descent.
As for the relationship to race, it has been common in racist biblical interpretation in history to argue that dark-skinned people come from Ham’s line and therefore should be the slaves of Shem or Japheth, which, conveniently, includes the person making the argument. There is obviously a lot wrong with this.
Firstly, these people groups do not have strong racial distinctions. It’s not as if Abraham (an Aramean) is a white man and the people of Ham (Babylonians just to the south-east, Assyrians to the north-east, and Canaanites to the south-west) are comparatively dark-skinned. Everyone is “brown”, and they are all living in the fertile crescent alongside one another. So trying to correlate “chosen” or “cursed” with skin colour is clearly absurd.
The idea that you can trace lineages from Noah to oneself is also massively problematic. Firstly, it assumes a literalism of the text that cannot be guaranteed. But even if one takes it literally, the argument is even worse. Shem, Ham, and Japheth, BEING BROTHERS, are of the same “race group”. Fairytales can have it that one brother fathers black people, and another brother fathers white people, but if this is literal, then the possibility of fathering white or black descendants is true of all of them. Maybe one can still identify some of the nations in Gen 10 and connect them geographically to oneself, but skin colour certainly isn’t a factor.
Secondly, the bigger problem (as much with literalism as any other view of the text) is that Noah’s curse makes Canaan (Ham) the servant of his brothers, but not a perpetual slave. Genesis doesn’t describe what always must be. It is true that Genesis probably intends to provide origin stories for features of later Israel’s world, and so there is some legitimacy to the argument that this applies down history. But it is perverse to use Gen 9 to justify evil as if it is God’s will.
Moreover, in Genesis this is not the only time that a brother is designated a servant. At the births of Esau and Jacob, it says that the older will serve the younger. Significant pronouncements are made about all the children who feature in the narratives of Genesis. Cain is cursed, and Ishmael’s line and many of Jacob’s sons are given mixed blessings too. Therefore, the curse on Canaan seems to put Ham’s line on a similar trajectory to that of Cain (as a line of rebels that was destroyed), indicating that he will not be the focus of God’s promises of blessing and foreshadowing the destruction of the Canaanites in later history. But Ishmael and Esau do not fare much better (and they are both of the line of Shem, not Ham). In other words, even in the chosen line of Shem, some branches are rejected and put into subjection to their brothers.
Genesis is tracing a line of blessing down to Jacob. Everyone else is excluded. Why would you (a) stop reading at Genesis 10, (b) give yourself the power to decide whose nation comes from which line, and (c) decide that this is how things ought to be forever? If every line’s fate is sealed in Genesis alone, then some of Jacob’s tribes have hope and the rest of us are doomed.