John Steinbeck's novel Of Mice and Men depicts life during the Great Depression in the 1920's. Life during this point in time were very different than today.
Blacks were not looked at as being equal citizens. They were still referred to by the "N" word. White women were looked at as having more rights, but they were still seen as below men.
Steinbeck used the characters of Crooks and Curley's wife to illustrate the ways in which both blacks and women were not held up in the same way as white men. The characterizations have provided many critics to examine the text from both feminist perspectives and Critical Race theory perspectives.
As for how he created the characters, no one knows the truth behind the actual reason other than Steinbeck himself. The only thing critics and analyzers can do is make educated guesses or assumptions about the "hows."
One could easily justify that Steinbeck wanted to show how women existed without true identities (they were part of their husband's identity) and how blacks were treated (could not stay with white workers and were treated badly by whites).