Dally didn't commit suicide he had a planned death. As Kiwii32 explained that he did mean to die but he didn't kill himself. Dally had a deep connection to Johnny but when Johnny passed away Dally had no one that really understood him like johnny. So he broke and planned to die
Johnny was the only thing Dally truly, deeply loved. The reason he loved Johnny so much was because Johnny was everything Dally couldn't be. Johnny felt things deeper (like Ponyboy) than the other greasers and realized that there was good in the world. Dally then felt like it was his purpose to save Johnny's "innocence" (his emotions,thoughts etc.) from the cruel things they had to endure. When he failed at this, his guilt took over and he then killed himself (by the hand of another). Dally also (obviously) loved him like a brother.