The PS2 spanks the X-Box handily in game quantity and variety. The X-Box had better hardware, though, so its games, especially late-gen, are undeniably prettier. Yet, it's been clear for years now that the PS2 cock-slapped the competition in the last-gen console wars, so that's worth something.
However, as fracicone mentioned, if you're looking into modding a machine, then the X-Box is the far easier path to take. With the hard-drive capabilities and the easy-breezy BIOS flashing, an X-Box can be converted into a pirate box with minimal fuss. The PS2 can be soft-modded, but you'll need to know someone with an already-modded PS2 or PS2 Fat to pull off the trick on the new slim models. I've heard Swap Magic might do the trick in getting the .elf files onto the memory card, but I've never tried it that way myself. In any event, if you search around, you'll find that there are volunteers you can ship your old PS2 mem card to and they'll put the softmod software on there for you, free of charge. It's also possible to install a hard-drive into a PS2 and load ISO images, but it's really more of a pain in the ass than what it's worth -- in my opinion -- so I've always just stuck with DVDs.
Anyway, I think the PS2 is the best choice. But the X-Box made a good run and neither should really disappoint.