Without such laws, there are products that would never come to market. Windows machines would only work with Internet Explorer for example. Windows machines would work with Linux. You would have to buy wiper blades from your car manufacturer.
It's a tough decision but there are protection laws to prevent someone who wants to purchase product A from also having to purchase product B in order to use product A.
I am 100% ignorant on this. That said, why is it that I have to buy product B (a game cartridge) to use product A (a Nintendo Switch)? Perfectly legal, right?