This is an excellent question to consider as there is no real answer to it, and both sides of the argument have excellent supporting reasons. Firstly, you could disagree with this statement. This is because it is clear in this novel that Ponyboy again and again is saved and protected by his gang from being badly beaten up by the Socs, in the same way that Johnny was beaten up. Therefore we can see that in this context, belonging to a gang is actually a very smart move because it brings you protection and a sense of belonging that you might not receive elsewhere. Let us also remember that for characters such as Johnny, whose parents are at best indifferent towards him, and characters such as Ponyboy and his brothers, the gang that they are a part of functions as the family that they don't actually have elsewhere. Therefore, belonging to a gang is an absolute advantage for them.
However, the contrary view would point out the way that belonging to a gang necessitates your involvement in fights or "rumbles" and other illegal activities. Being part of a gang means that you are automatically opposed or in conflict with another group, and we can see how this impacts the lives of Johnny and Ponyboy when Johnny kills Bob. Therefore we could equally argue that belonging to a gang can only result in trouble as it sets of a chain of events that leads to Johnny's death.