When Mercutio and Tybalt duel, Romeo tries to break it up. He steps between the two fighters, and "Tybalt stabs Mercutio" under Romeo's arm (according to stage direction). When Benvolio helps Mercutio to leave the stage, Romeo says of him;
This gentleman, the Prince's near ally,
My very friend, hath got this mortal hurt
In my behalf. My reputation stained
With Tybalt's slander—Tybalt that an hour
Hath been my cousin! O sweet Juliet,
Thy beauty hath made me effeminate
And in my temper softened valor's steel. (3.1.114–120)
Romeo is aware that Tybalt was really coming after him, and Mercutio received his mortal injury while fighting to defend Romeo's honor. Mercutio felt that Tybalt was speaking disrespectfully to and about Romeo, and so he stepped in to fight Tybalt when Romeo continued to refuse. Now, Romeo seems to feel responsible for Mercutio's death, and this sense of guilt and responsibility likely helps to compel him to fight back.
When Romeo sees Tybalt again, he says of him, "Alive in triumph, and Mercutio slain!" (3.1.127). He cannot allow Tybalt to remain living while his friend Mercutio is dead. He says to his enemy:
Is but a little way above our heads,
Staying for thine to keep him company.
Either thou or I, or both, must go with him. (3.1.131–134)
Because Romeo and Tybalt are responsible for the death of Mercutio, Romeo says that one of their souls must accompany his to the next life.
Romeo kills Tybalt to avenge the death of Mercutio at the hand of Tybalt. Despite the fact that Romeo is complicit in Mercutio's death, he blames Tybalt solely. Romeo, as true to his character, acts impulsively and without reflection in his murder of Tybalt. It is only after Tybalt's death that Romeo realizes the full extent of what he has just done when he states, "O I am fortune's fool!" Romeo realizes that his killing of his new wife's cousin sets into motion a fateful series of events that will likely keep Romeo and Juliet apart. This is how the plot of the play changes from this point forward; we know that Romeo and Juliet will never be able to be together.
Concerning Shakespeare's Romeo and Juliet, in short, Romeo kills Tybalt because Tybalt kills Mercutio. Of course, it isn't really that simple.
Romeo, newly in love with Juliet--a member of the hated enemy, the family that Romeo's family constantly feuds with--wants now to make peace. While doing so, he gets in the way of Mercutio and Tybalt while they are fighting. The two are partly serious and partly playing around, but the game is dangerous, since the game is sword fighting.
In getting between the two fighters, Romeo inadvertantly causes Mercutio not to be able to react to a thrust by Tybalt, and the thrust mortally wounds Mercutio.
Romeo becomes angry and loses control and kills Tybalt out of revenge. At the same time, Romeo is probably lashing out at Tybalt due to his own guilt for having contributed to Mercutio's death.