Following the greasers' triumphant battle with the Socs at the rumble, Dally and Pony sped off to tell Johnny about their victory. But Johnny had only a few moments of life left, and he told them that fighting wasn't the answer to their problems before he died. Johnny's death devastated Dally, and it was the last straw for him. He could see no reason to continue living, so he robbed the market with an unloaded gun, and while running to meet up with Darry and the rest of the boys, he was confronted by police. Dally chose to die, waving the gun at the police who, not realizing it was empty, killed Dally in the street. He chose suicide-by-cop rather than trying to go on with life without his best pal.
Because he wanted to get killed by the police
Dally pulled the gun on the Police because he no longer wanted to live. He was depressed about Johnny's death and couldn't live with it anymore.