The 360 is better in terms of graphic quality and the ability to play games with friends online (if you pay Microsoft their yearly fee, which I don’t). As well, you get to play the newest and coolest games, which are very rarely released for PS2. Don’t be worried about the red rings, they’ve fixed a lot of it and still have replacement programs for if it occurs.
On the other hand, the PS2 is a very very reliable console, the game library is massive (and compatible with PS1 games too), the SDK is well known thus the few developers still making games for it are able to squeeze all the power out of the console and make great results, and the system is less expensive overall.
Both consoles play CDs and DVDs, I believe the Xbox lets you rip your CDs and play the music while in a game so that’s pretty cool.
What would I recommend? Both! That’s what I have. I tend to play the 360 more, but the PS2 is a valuable addition in my console library (as well, I have a Wii). I use it for playing DDR as I have a ton of PS1 and 2 DDR games, I also use it to play my extensive PS1/2 game collection whenever I feel nostalgic. But if you were to purchase only one, I would recommend buying the Xbox 360 new (so that you get the warranty) and later on buying a used or new PS2 if you really want it.