Crooks, in Of Mice and Men, could be taunting Lennie for a few reasons.
First, Crooks realizes how much George means to Lennie. Crooks is also aware that Lennie is slightly mentally challenged (which mirrors Crooks' physical challenge). Since Crooks has most likely been the center of harassment (given his disability and the fact that he is Black), he finds this as his chance to give someone else "the riot act."
Second, and similarly, Crooks is alone. Both his race and his disability have forced him to be exiled by the other ranch-hands. This said, Crooks may be either jealous of Lennie or want someone to sympathize/empathize with him.That being said, if Lennie is to believe that George may not come back, then he may become friends with Crooks out of need--something Crooks honestly desires.