It's the same reason you probably said "I love you" to the first person you slept with. Looking back, did you? No. A more accurate admission would have been to say, "I'm addicted to you."
Your friend finally breaks up with a girl that was so completely wrong for him and says to you, "What was I thinking???"
Sex is addictive. But, if your goal is long-term relationship, you really need to wait until marriage. Because over the long term, it's much more important to be addicted to the person.