Yes, the CD could be produced that poorly. So could the LP. There's a lot of mediocre recordings out there. But the way you're comparing them opens up far more logical possibilities, including speed variation. You should definitely check your turntable. I've heard of turntable makers intentionally setting their tables a little fast, just to impress listeners.
Another thing to remember is that levels matter. If you were playing the LP even slightly louder than the CD, it might well sound better, as you describe it. And level-matching by ear doesn't necessarily work. Two things that seem identically loud can be off by several tenths of a dB, and that's enough to make them sound different. That said, there's no way to perfectly match levels between a CD and an LP, because of the inherent differences in the media. (Also, if you're the one with your finger on the volume knob, and you already believe that vinyl sounds better, it's possible that you're subconsciously playing the LP just a little bit louder. Let your friend do it.)
Finally, there are various aspects of vinyl which make it sound different from CD, and different in a way that often appeals to listeners. So that, too, probably played a role in your impressions.