Yes, it spoils it. You won't understand what the hell is going on in X-2 if you don't finish X. Play it, and then play X-2. X is my favorite game of all time.
--------------------------------------------------------------------
Trakan,
Wow, I'm not the only one. X is also my favorite game ever (I've been playing since the Atari 2600 days, I just love that game).
Can you play X-2 without X, probably. Really, you'll figure out what happened enough to get what's going on. But, it will ruin X for you, for the most part (especially some of the really dramatic story twists, though you can see them before they actually happen).
I'd play X first. Plus, I think its the better game. X-2 is a great sequal, and is great for more light hearted play, but it really fits together if you play X.