Wilmer Cook is extremely loyal to Casper Gutman. He commits two murders for him in The Maltese Falcon and very likely has committed others before. He kills Floyd Thursby and Captain Jacobi. He would like very much to kill Sam Spade. Eventually we learn that he has killed Gutman because his employer agreed with Spade to turn him over to the police as the "fall guy."
Dashiell Hammett is careful to establish his characters' motivations. Spade, for example, has several motives. He wants to avenge his partner's death. He wants to clear himself of suspicion of killing Miles Archer and Floyd Thursby. He might make some money off the Maltese falcon if it exists, if it is genuine, and if he can get his hands on it. Brigid O'Shaughnessy's motive is pure greed. Gutman's is greed plus a strong desire to acquire a fabulous artifact. Joel Cairo is being paid by the Russian General Kemidov. Lieutenant Dundy and Sergeant Polhaus want to solve three murders—Archer's, Thursby's, and Jacobi's. Thursby is in love with Brigid. Archer is strongly attracted to her. Captain Jacobi must be in love with Brigid too, since he loses his life trying to help her. All the main characters have obvious motives except Wilmer Cook. Hammett inserts a minor character to explain why Wilmer is so loyal to Casper Gutman.
Gutman has a fabulously beautiful young daughter named Rhea. When Spade goes to Suite 12-C at the Alexandria Hotel in response to a phony call for help from Brigid O'Shaughnessy, he finds Rhea there alone. She pretends to have been drugged and to have been keeping herself awake while waiting for him by scratching her abdomen with a "three-inch jade-headed steel bouquet-pin."
"She . . . opened her dressing-gown. She pushed aside the cream-colored pajama-coat under it and showed him her body below her left breast—white flesh criss-crossed with thin red lines, dotted with tiny red dots, where the pin had scratched and punctured it."
This was pretty risque writing when the novel was first published in 1929. Later, when Spade finds that he has walked into a trap at his own apartment, he tells Gutman, "That daughter of yours has a nice belly . . . too nice to be scratched up with pins."
Wilmer's reaction to this explains his motivation for staying with Gutman and doing his dirty work.
"The boy in the doorway took a short step forward, raising his pistol as far as his hip. Everybody in the room looked at him. In the dissimilar eyes with which Brigid O'Shaughnessy and Joel Cairo looked at him there was, oddly, something identically reproving. The boy blushed, drew back his advanced foot, straightened his legs, lowered the pistol and stood as he had stood before, looking under lashes that hid his eyes at Spade's chest. The blush was pale enough and lasted for only an instant, but it was startling on his face that habitually was so cold and composed."
Sam Spade is deliberately provoking Wilmer. Spade has guessed that the boy is in love with Rhea Gutman and may have been receiving encouragement from her father that he might have a chance to win her. The main reason for Rhea's existence as a character in the novel is to provide visible evidence of Wilmer's motivation. Since Rhea is obviously controlled by her father, she may have been ordered to show a modest amount of interest in Wilmer—although in the long run he wouldn't stand a chance.