To Lennie, Curley's wife is a "soft thing" to which he is attracted in a way that can be described as compulsive. Very early in the book the results of this compulsion is implied in Lennie's treatment of mice. Also, Lennie's compulsive actions led the pair to be run out of their last job.
at the very beginning of the book, the reader learns that George and Lennie had to leave Weed because Lennie got into trouble when he tried to touch a girl's dress.
Curley's wife is presented as being "trouble", a "tart", and a danger to all the men on the ranch. This characterization is consistent and begins with her introduction into the action of the book. Though later we learn that Curley's wife is merely lonely and living a life of lonely hopelessness, she is initially seen as being an immoral person, willing to get other people in trouble.
Steinbeck creates a specific sense of trouble Lennie by having George repeatedly warn Lennie to stay away from Curley's wife. From her first appearance, when Lennie has a predictable reaction to Curley's wife, George associates the woman with danger.
Though her visit is brief, it is enough for Lennie to decide she is beautiful and for George to decide that she is a troublesome tramp.
George's repeated warnings go a long way to developing an air of danger around Curley's wife, foreshadowing the disaster at the book's end.