Lennie is lonely in the novella for two reasons. First, very few people understand him. He is mentally challenged and so people do not know how to interact with him. So, people just ignore him and marginalize him. The opposite also happens. Lennie does not know how to interact with people, because he lacks social skills. For example, George and Lennie had to flee, because the people thought that Lennie attempted to rape a young woman, which was not true. Lennie just wanted to touch her soft dress.
On another level, we also need to say that all people in Steinbeck's world are lonely. This is one of the most salient features of the novella. Based on this point, Lennie is actually not as lonely as the others. He at least has George. Curley's wife, Crooks, and Candy are far lonelier.