The sons of Noah who went forth from the ark were Shem, Ham, and Japheth. (Ham was the father of Canaan.) These three were the sons of Noah, and from these the people of the whole earth were dispersed.
Noah began to be a man of the soil, and he planted a vineyard. He drank of the wine and became drunk and lay uncovered in his tent. And Ham, the father of Canaan, saw the nakedness of his father and told his two brothers outside. Then Shem and Japheth took a garment, laid it on both their shoulders, and walked backward and covered the nakedness of their father. Their faces were turned backward, and they did not see their father's nakedness. – Genesis 9:18-23
This passage is intriguing for multiple reasons. First, that Noah “began” to be what the original curse upon Adam was (Gen 3:19, 23). Cain was a “man of the ground” (Gen 4:2). What is striking is the introduction of this thought at this point of the story of Noah. Perhaps this is an indication that fermented drink had not been introduced yet or perhaps it is setting up the poor decision of Noah on the basis of him “depending on the soil” like Cain had done (Gen 4:3).
The second interesting element of this text is the story of Ham. Read straight forward it seems a rather petty thing that receives such a great punishment. Multiple reasons have been explained but two are the strongest and most Hebraic. The first is that in seeing his father’s nakedness, Ham was trying to become greater than his father and take his authority. Something similar in the history of Israel may be Absalom going into his father David’s concubines (2 Sam 16:21-22).
The second, though crass, is that Ham had sexual relations with his father while he was drunk. This argument has the literary argument from the Hebrew word and its use in the Old Testament law (Lev 18). It also works as a precedent for the behavior of Lot with his daughters (Gen 19:30-38). Even the focus of the effects on future generations seems to come into play in both examples.
Both options are viable and neither is mutually exclusive. Taken together, it is evident that Ham was more than mocking his father. He was attempting to rule over him and subsequently found himself cursed to be a slave.