Yes, the law is to blame. The companies never would have done any of this except for the law. The GDPR is the reason the web is festooned with ridiculous cookie consent forms of all kinds, both the good ones and the bad ones.
Keep in mind too that I am not a citizen of an EU country. I have to put up with these dialogs and I get nothing in return. The upside for EU citizens is that they have a law to protect them. All I get is the downside.