When Noah awoke and realized what had happened, he put a curse on Ham's son, Canaan.
"cursed be Canaan; a servant of servants he shall be to his brethern." Genesis 10:25
Ham's lack of respect for his father's nakedness had a spiritual force to it. It revealed something of what was going on in his heart with his relationship with his father and God as well.
Then Noah blessed the sons of Shem and Japeth.