You actually don’t have to pay to use Xcode. You only need to pay to build for real devices and submit to the App Store.
I think the OP means is that even for free (as in beer) Apple software you still have to have a credit card attached to your account (or at least you used to), even if it isn't actually charged, because of the way the App Store works.