Cherry's reason for becoming a spy is two-fold. First of all, through her very personal discussion with Ponyboy at the drive-in, she came to realize that Greasers had feelings and trouble just like the Socs. She came to see Ponyboy as a person, not just a greaser and appreciated his "protecting" her at the drive-in and the walk home. Also, Cherry felt some sense of guilt or obligation to the Ponyboy and Johnny as she knew if they had not befriended her and Marcia at the drive-in that Bob and Randy would not have been seeking revenge on them in the first place.
In the book "The Outsiders" Cherry had met Pony Boy and Johnny at a drive-in movie. They had becomes friends and she likes him. Cherry had been the Soc Bob's girlfriend. Bob and two of his boys had attacked Pony Boy and Johnny had killed him in order to protect Pony Boy.
The two boys went into hiding after Dally had arranged it. Cherry is aware that something needs to be done. She feels bad about the situation with the boys and begins to spy for the Greasers. She is hoping to prevent the Greasers from being taken off guard by the Socs. She also still likes Pony Boy and has learned that there are two sides to the Greasers.
Cherry Valance had met Ponyboy Curtis and Johnny Cade at the drive in after Dallas Winston told Cherry to "cool down". So then after that Marcia and Cherry asked Johnny and Ponyboy to move up with them and so maybe they can protect Cherry and Marcia from boys like Dallas (Dally) Winston. So from that point on they have just been friends and they have talked ever since.
So after the scene when Ponyboy and Johnny were getting beat up by the Socs and Johnny had killed Bob the Soc because he and his friends (bob) were going to drown Ponyboy so he pulled out a knife and he stabbed him. So after that happened she thought that she had owed them (ponyboy and johnny) something so before the rumble she easedropped on the Socs and tried to figure out if there was going to be any weapons.
I think that Cherry wants to be a spy because in a way she know that bob was probably guilty and she feels sorry for what happened