* To gain favor and popularity: Stanley is new to Camp Green Lake and is trying to fit in. He understands that X-Ray is one of the leaders and by giving him the lipstick, Stanley hopes to gain X-Ray's friendship and protection. Stanley feels like gaining X-Ray's favor will prevent him from being a target of the other boys.
* He thinks it might be valuable: When Stanley finds the lipstick tube, he knows that it might be something important and that X-Ray might want it.
Essentially, Stanley's actions are a calculated attempt to improve his standing in the social hierarchy of Camp Green Lake.