One, I guess, is to be quoted; and the other, to be misquoted.
The truth is that Bernard Shaw indeed put the following words in the mouth of one of his characters - Mendoza, the Spanish brigand from Man and Superman (1903):
- MENDOZA. [advancing between Violet and Tanner] Sir: there are two tragedies in life. One is not to get your heart's desire. The other is to get it.
It is also true, however, that one may arguably trace these words back to Wilde's Lady Windermere's Fan (1892), in which Dumby utters a very similar sentence:
- DUMBY. I congratulate you, my dear fellow. In this world there are only two tragedies. One is not getting what one wants, and the other is getting it. The last is much the worst, the last is a real tragedy!
In view of these data, and the intertextual connection therein (something others had noticed long before me), one should take alleged Shaw quotations in cheesy teen TV series with a pinch of salt.
Regardless of how many times Shaw had his heart broken, it was Mendoza who said the words, not Shaw. Besides, never underestimate the teachings of Man and Superman; after all, it is one of Lisa Simpson's favorite books: