If Shakespeare had depended on surprise for his plays to be enjoyable, you would never have heard of him. People would see the play once, get the full effect, and then there would be no point in going again.
Roger Ebert said, "It's not what a movie is about, it's how it is about it." The same goes for plays. Shakespeare tells you the ending up front because he wants you to not just wait for the surprise, but to watch how it happens to them. There are many different causes: their parents, their friends, their youth, even something as simple as a message that went astray.
It's much like your own life. Spoiler alert: you're going to die. What matters is how you live between now and then. As actors, we strive for authenticity at each moment. The question we constantly ask, "What is it that the character wants most in the entire world? What is preventing them from getting it?" That's how enjoyable performances are constructed: the intensity of each instant, regardless of the outcome.
There's a wonderful moment in the film Shakespeare in Love, where Juliet rises and asks, "Where is my love?". The audience is in tears, and one answers her: "Dead!" The audience member knows what's going on, but Juliet doesn't. The moment is powerful because we know what she's about to learn. She's being carried by forces more powerful than herself, and the tragedy is in how she reacts to them, instant by instant.
Shakespeare's audiences knew the ending of Romeo and Juliet before he even set pen to paper. Shakespeare rarely constructed novel stories. He repeated well-known tropes. The audience didn't sit through it in order to get a surprise ending; if anything, that would have annoyed them.
And that's true of modern audiences as well. When you go catch a James Bond movie, you don't need a spoiler alert that Bond wins and the villain loses. In a rom-com, it doesn't matter whether boy-gets-girl-back really follows boy-meets-girl and boy-loses-girl: they have different effects, but what's important is how he goes about getting her rather than his success.
To repeat myself for one final redundancy: the benefit of "spoiling" the ending is that the audience is relieved of the pressure of guessing how it turns out, and get to focus instead on the individual moments. If you just wanted to know the end of the play, Shakespeare would tell you, "Save your penny: they die."1 The reason you sit through the two hours traffic on that stage is to see how they get to die.
- Actually, I don't see him turning down cash. Theater is always on the brink of bankruptcy.