According to Rav Hirsch, Noach had gone to to his private chamber, to avoid humiliation. Cham intentionally followed his father inside so that he could see him in his state of inebriation.
The story of Cham thus teaches the lesson of affording people privacy. People are entitled to retreat to their “private chamber,” a place where they can keep the less impressive aspects of their characters out of the public eye. Cham’s offense against his father was denying him this basic right, following him into his private room to expose his shame.