You're focused to much on Amazon. Every company does this just go to your local Walmart, everything is white-label. A law like this would have to be applied to them as well.
On the contrary, house brand products are great for consumers. Rather than having to figure out if they can trust a brand for a product category that they really don't care about, they can just buy the house brand knowing that a certain minimum level of quality exists. This is why Amazon Basics products are so popular on Amazon: consumers know that, at the very least, Amazon can be sued, a form of recourse that is not available with most of the smaller brands and sellers on their platform.
This is me. I bought an AmazonBasics product initially, a phone cable, thinking it would be crap. It wasn't. So I bought another one, a set of HDMI cables. They weren't crap either! Then I bought AmazonBasics wash cloths as a joke. They were quite nice! Now I find myself shopping around the AmazonBasics section first. I still find it amusing in a "Spaceballs, the flamethrower!" kind of way.
Similarly how Microsoft launching Internet Explorer to beat Netscape and eat another Market was technically more competition (for a while, until they've established another monopoly and all competition ceases).