Ge 9:18 Now the sons of Noah who went out of the ark were Shem, Ham, and Japheth. And Ham was the father of Canaan.
19 These three were the sons of Noah, and from these the whole earth was populated.
20 And Noah began to be a farmer, and he planted a vineyard.
21 Then he drank of the wine and was drunk, and became uncovered in his tent.
22 And Ham, the father of Canaan, saw the nakedness of his father, and told his two brothers outside.
23 But Shem and Japheth took a garment, laid it on both their shoulders, and went backward and covered the nakedness of their father. Their faces were turned away, and they did not see their father's nakedness.
24 So Noah awoke from his wine, and knew what his younger son had done to him.
25 Then he said: "Cursed be Canaan; A servant of servants He shall be to his brethren."
26 And he said: "Blessed be the LORD, The God of Shem, And may Canaan be his servant.
27 May God enlarge Japheth, And may he dwell in the tents of Shem; And may Canaan be his servant."
28 And Noah lived after the flood three hundred and fifty years.
29 So all the days of Noah were nine hundred and fifty years; and he died.
Here Moses shows that the line of blessing narrows down to two of Noah's sons Shem and Japheth, with Shem taking the lead in the enjoyment of the blessings. The Israelites were the descendants of Shem through Abraham.
Ham and his son Canaan forfeited the blessing through their sin. Ham shamed his father (Noah) and so, as punishment, his son (Canaan) and Canaan's descendants will bring shame to him.
It is a shameful thing to look upon the nakedness of a parent and not do something about it. Instead of covering it, like what Shem and Japheth did, Ham did nothing about it. He even went out and told his brothers. His actions revealed his attitude about the whole thing.
Noah saw that the character of his grandson Canaan was like that of his father, and so, as punishment, he cursed Canaan.
Shem received the greater blessing because apparently he was the one who took the lead in covering his father's nakedness. His name is mentioned first in verse 23.
Moses is showing his Israelite readers here the supremacy that God has given to Israel over other nations. Canaan will be his servant and it was indeed fulfilled when Israel conquered Canaan. And Japheth will partake of Shem's blessings under Shem's tent.
The fulfillment of this is seen in the Gentile (Japheth) domination of the world in the Babylonian, Graeco-Persian and Roman empires. Israel was promised by God that they would have earthly dominion if they obey Him. But that promise or blessing went to the Gentiles when they did not keep the covenant.
Spiritually, Gentiles now share in the spiritual blessings of Israel's New Covenant.
Noah was blessed with long life like the other godly men listed in Genesis 5.