Why would it be illegal? T-Mobile is a private company, and they can do what they like. (whether they should...)
Probably the same type of agreement that permits them to block spam calls on your behalf, deep inside the EULA.
it's not true
No. It's true. I have T-Mobile, and I cannot send .xyz links over SMS.
If you have T-Mobile, this is easy to verify: text yourself "abc.xyz" (or any other .xyz link) The message will show as sent but not received. If you text yourself any uncensored link, it will show as sent and received.