What are some of the events in the West Side Story that set up the tragic ending?
In answering this question, I think you want to examine the structure of the play. There are two stories happening here: The narrative of the Sharks and the tale of the Jets. Look at how the Jets perceive life and how the Sharks view reality. You can sense this in the songs and dialogues (The Jets are driven by territory, and holding on to what is theirs because there it little else in their lives. The Sharks are driven by not being accepted in American society and trying to earn their share of the American Dream.) Pay attention to actual lines and some of the songs that help to heighten this ("Gee, Officer Krupke" for the Jets and "To Be in America" for the Sharks).
I think looking at both narratives helps to set up the tragic conflict in the play. The fact that Tony and Maria pledge devotion to each other, outside of their worlds, help to invariably pull both in their worlds. I would also pay attention to how events unfold after the Rumble with Bernardo and Riff. This would involve how each gang decides to address life after their leader dies. Finally, pay special attention to Anita and her role in both trying to make peace and being a woman whose man has been killed. Her role helps to contribute to the ending, without being a deliberate and intentional part to it.