The Outsiders by S.E. Hinton is essentially a gang story, so we should not be surprised that gangs play such a significant role in the novel. Johnny is not the protagonist of the story; nevertheless, we know a lot about his life.
The short answer to your question is that the gang is important to Johnny because his fellow gang members are essentially the only real family he has.
Johnny is sixteen years old, and his home life has been a disaster. Ponyboy says Johnny looks like
a little dark puppy that has been kicked too many times and is lost in a crowd of strangers.
Ponyboy's assessment is pretty accurate. Johnny has been virtually ignored by his mother, and his father does nothing but abuse him. It is no wonder that Johnny is desperate to escape that environment--and the best part for him, quite frankly, is that no one notices his absence.
As if his treatment were not bad enough, Johnny also lives in fear of his life because he had a run-in with the Socs, a rival gang, in which he was horribly beaten. He sleeps outside a lot of the time, and he never really gets enough to eat. His life is pitiable in nearly every way. Life is so consistently bad that he considers suicide.
Once he becomes a member of Ponyboy's gang, Johnny is adopted as "everyone's kid brother." He is the youngest member of the gang, and the other members treat him well. Johnny is in a gang, but he is still a stand-up guy. He does not deliberately hurt anyone (with one glaring exception, late in the novel and with a reason). In fact, he stands up when he sees injustices.
While the gang serves as a kind of surrogate or substitute family for Johnny, the gang is still just a bunch of kids. They all do what they can, but of course it is not enough to rebuild a foundation for Johnny. His gang family is better than his real family, but they cannot completely fill the gaps left by his terrible home life.
For more interesting insights and analysis on this classic novel, visit the excellent eNotes sites linked below.
In the book Johnny said multiple times that his parents abuse him. In the beginning of the book Darry said that the front gate and the door is unlock so any of the member of the gang can come in anytime, but I think he is targeting the sentence towards Johnny. On multiple occasion the story, they said Johnny had to sleep in the vacant parking lot since his parents would kick him out. When Ponyboy and Johnny was looking out into the stars he woke Pony up when he fell asleep and told him go home and don'y worry about me because my parents wouldn't bother. When Johnny was crushed by the falling wood in the church and sent to the hospital, the nurse told Johnny his mother came to see him. He declined the nurse and told her to leave. The nurse told him that it was his mother though. Johnny's reply was about how much she actually hates him, and his dad would probably be happy/celebrating if he died. This proofs to the reader that Johnny's love is only towards the gang and the gang's love is to him. Without the gang, Johnny would have had a very miserable life all by himself. He gets the comfort from the gang members. He had a wonderful life with Ponyboy and wanted to stay more and show Dally the sunset before he passed away for good, but of course he doesn't know Dally Winston has died because of the grief for Johnny.
Johnny was abuse by his parents to the point he gets kicked out of the house. When he does get kicked out of the house he is forced to sleep in the vacant lot. Thus meaning he has no love to share with his family so he shares his love with the gang members of the Greasers.