Ham's Failure
Noah's family, having stood on the successfully laid foundation of faith, then had to set up the foundation of substance. Just as with the first son Cain and second son Abel in Adam's family, Noah's first son Shem and second son Ham had to indemnify and restore the foundation of substance by making an acceptable offering with utmost loyalty to God.
To do this, the second son Ham, had to become inseparable in heart with his father, Noah, who established the foundation of faith and became the central figure of God's providence.
However, Ham failed to be completely one in heart with Noah, and showed a lack of faith in his father (Gen. 9:20-26), who was in the position to be completely separated from Satan. Thus Ham came into the position where Satan could invade and claim him. This is why Noah cursed Ham's son, Canaan, to be a slave to his brothers (Gen. 9:25).