In Act 5, Scene 5 of Julius Caesar, it is evident that the armies of Cassius and Brutus are losing the battle of Philippi. Cassius commits suicide in Act 5, Scene 3. Brutus is planning to commit suicide by running against his own sword if he can find one of his attendants to hold the sword pointed at him. Brutus tells Volumnius:
The ghost of Caesar hath appear'd to me
Two several times by night; at Sardis once,
And, this last night, here in Philippi fields:
I know my hour is come.
Shakespeare wanted to justify calling his play Julius Caesar even though Caesar is assassinated halfway through it, and even though Brutus has a more prominent role during the first two acts while Caesar is still alive. Shakespeare has Caesar's ghost appear to Brutus, and he also has both Cassius and Brutus acknowledge that the spirit of Caesar is still alive and inspirinig those who are avenging his death. Brutus tells Volumnius:
Thou seest the world, Volumnius, how it goes;
Our enemies have beat us to the pit:
It is more worthy to leap in ourselves,
Than tarry till they push us. Good Volumnius,
Thou know'st that we two went to school together:
Even for that our love of old, I prithee,
Hold thou my sword-hilts, whilst I run on it.
He finally persuades Strato to hold his sword for him as he runs into it. His dying words are significant:
Caesar, now be still:
I kill'd not thee with half so good a will.
Brutus knows he cannot surrender to Antony and Octavius. They would surely execute him.
Cassius has had one of his servants kill him in Act 5, Scene 3. As he is dying he says:
Caesar, thou art revenged,
Even with the sword that kill'd thee.
And in that scene when Brutus learns of his friend's death he says:
O Julius Caesar, thou art mighty yet!
Thy spirit walks abroad and turns our swords
In our own proper entrails.
Obviously all this is done to justify titling the play Julius Caesar. Otherwise, it might seem that it is the tragedy of Brutus, as has often been suggested by some critics. Brutus is the most sympathetic character in the play. Caesar himself seems arrogant, vicious, and ruthlessly ambitious.
Perhaps the simple answer to the question, "Why did Brutus die?" is that he had to die because he died in real history more or less as Shakespeare has shown.