Earlier quoted context omitted.
It falls under the "nominative use" defense to an assertion of trademark infringement. Free speech has nothing to do with it. Trademarks are intended to provide consumers with the confidence that the products they're buying really come from the producer they claim to come from. As such, you're prohibited from assembling your own computer and branding it Apple; you've never been prohibited from referring to Apple.
It was my understanding that this doesn’t cover using a trademark in a domain name. I could be wrong; my only experience of this is that “WordPress” is a trademark, and therefore it’s generally accepted that any WordPress related product is not allowed to use the trademark in their domains.
"Even if [the] use is commercial, it must still lead to a likelihood of confusion to be violative of the Lanham Act. 15 U.S.C. § 1114(1). In Planned Parenthood, the defendant used the plaintiff's trade name as a domain name, without the qualifying moniker 'sucks,' or any other such addendum to indicate that the plaintiff was not the proprietor of the website. In contrast, 'taubmansucks.com' removes any confusion as to source. We find no possibility of confusion and no Lanham Act violation."