That's a complicated question, for several reasons. One, love isn't always a painful experience for people (and most would consider painful love a generally bad investment). Two, when people "fall in love" or love somebody, they usually don't expect the relationship to BE painful; that's something that tends to come a bit after the initial wanting and receiving, if it occurs at all.
With that aside, though, love can most definitely hurt, especially when the feeling isn't returned or the person you love is lost. So if you KNOW it can hurt, either from experience or observation, why would you continue to pursue such a risky venture?
Because it's worth it.
Love is a really epic thing, no doubt. It's complicated at times, annoying, frustrating, and a whole host of other adjectives, but it IS enjoyable. There are few things people obsess quite so much about, and that's because it's one of life's most potent natural highs. A few break-ups and heartbreaks, no matter how painful they may be, generally pale in comparison with the prospect of the happiness and comfort love can bring. And since everyone has a desire to be wanted and loved by somebody, be it for friendship or romance, it's something we all strive for.
After all, a life with the pain of the occasional rejection is hardly as daunting as the prospect of a life spent utterly alone and without companionship. Really, it's the better alternative.
Hope that answers your question!