Curley's wife is so lonely on the ranch because she is new there, is the only female, and doesn't get along well with Curley.
We learn early on from from Candy that Curley and his wife have only been married for "two weeks." She hasn't had a chance to settle in and make a life for herself. Being the only woman on the ranch isolates her. She says to Crooks, who wants her to stay of his room,
Think I don't like to talk to somebody ever' once in a while? Think I like to stick in that house alla time?
She goes on to explain that the self-absorbed Curley only wants to talk about himself. She gets tired of hearing his bragging blow-by-blows about fights he has gotten into:
Think I'm gonna stay in that two-by-four house and listen how Curley's gonna lead with his left twice, and then bring in the of right cross?
Curley's wife is a teenage girl who would like to be truly seen by someone for the person she is. Her husband understands her as a trophy wife or prop to support him. She dresses brightly and provocatively to attract the attention she so badly needs. She wants to not feel invisible, and yet her dress and makeup earn her the label of a "tart" by the men of the ranch. They try to avoid her so as to avoid trouble, which further isolates her.
Curley's wife herself is shallow from having had a narrow life. She tries to reach out, but she is so young she lacks the wisdom to know how to do it effectively.