When reading a novel, it is important to consider the narrative and all the elements of fiction as a whole. For, it is erroneous to evaluate scenes solely as isolated incidents, when they are often connected to previous foreshadowing or other incidents. This incident of Curley's entering the bunkhouse and seeing Lennie smiling is an example. For, the simple happiness Lennie displays as he contemplates his and George's dream is misinterpreted by Curley as a smirk of Lenny against him. after the derogatory remarks of Carlson and Candy who have accused him of being "yella as a frog belly" and weird about his one hand: "What the hell you laughin' at?...I'll show you who's yella." (Curley also feels safer saying something to Lennie because he has observed George telling him to be quiet.
And, this misinterpretation carries much import for the entire narrative of Steinbeck's Of Mice and Men. First of all, this misinterpretation of Curley about Lennie's smiling indicates Curley's insecurity about being short. For, he thinks Lennie is scoffing at him as physically inferior. Secondly, this misread of Lennie causes Curley to foster aggressive, antipathetic feelings toward Lennie. So, when he takes a swing at Lennie, there is verisimilitude that has been established since he thinks Lennie will not fight and he can punch him quickly, whereas Carlson and Slim would probably not let Curley even take a swing at them. Finally, these scene underscores Steinbeck's theme that alienation from others--as the itinerant workers of the Depression era were--makes for fearfully agressive men who try to disguise their vulnerability.
You don't really have to even think about this one. In other words, you don't have to try to infer from the book why Lennie is smiling. You don't have to infer because the author comes straight out and tells you .
He says that Lennie is smiling when Curley enters the bunkhouse because he is thinking about the ranch that he and George are planning to buy when they get enough money.
Lennie loves the idea of the ranch and he's unaware enough that he could just keep grinning stupidly at the thought of it while a really tense situation is developing between the other men.