1. It is not right out illegal. The law does not specify that you are allowed to open and make changes and still allowed for warranty, for example replace motherboard of the xbox but still get warranty on the HDD, just because you want. It has exceptions, rules, and different behaviour and statements.
2. Those articles keeps stating the same law without really understanding it. The law from 1975 they state (and I'm not a US citizen, but I can still read it), also has exclusions which people for some "mysterious" reasons forget to read:
such warrantor may not exclude or limit consequential damages for breach of any written or implied warranty on such product, unless such exclusion or limitation conspicuously appears on the face of the warranty; and
aka, the label fully there, and sits on the screws, very conspicuously, that you must not open the product.
Notwithstanding paragraph (1), a warrantor may require, as a condition to replacement of, or refund for, any consumer product under subsection (a), that such consumer product shall be made available to the warrantor free and clear of liens and other encumbrances, except as otherwise provided by rule or order of the Commission in cases in which such a requirement would not be practicable.
Meaning the warrantor can demand that the product will not be damaged, and opening the box by unauthorised hands, doing who knows what, can be considered part of it. After all, a consumer can open the xbox or PS boxes, replace the HDD with a malfunctioned one, or replace parts from old out of warranty xbox, and demand replacement right? But if he opened the box, well...MS can't tell if he replaced or tempered, which means, no warranty.
The law, just like it is guarding consumers, also have exceptions in some way to protect warrantors from fraud.
Unlike some examples in the same articles (which pretty much all say the exact same thing, which means they pretty much just copy-pasted from the same click-bate), the xbox is considered a "black box", which is fully allowed under the law (until the commission stated in the law state otherwise). FCC rules are way too broad, but they also have their own exceptions. There are no specific rules for the xbox or PS or phones, etc etc.