The pain of loss does not outweigh the pleasure of love.
The expression has its source in Canto 27 of In Memoriam (1850) by Alfred, Lord Tennyson:
I hold it true, whate'er befall;
I feel it when I sorrow most;
'Tis better to have loved and lost
Than never to have loved at all.
The poem is a requiem for Tennyson's friend Arthur Henry Hallam, who died suddenly of a cerebral haemorrhage in 1833. Written over 17 years, it is considered one of the great poems of the 19th century.
Earlier, in 1700, William Congreve expressed a similar sentiment in his play, The Way of the World: "Say what you will, 'tis better to be left than never to have loved."