All of that is because the internet and more specifically the browser was made/evolved in a naive/idealist non-commercial mindset.
It was for university research work at first, where paying for the content was not a question because it was already paid for by others.
Then the companies who took over browser development didn't care about having a monetization/identification part to it because they didn't have content to monetize and didn't need to have their users pay for it either.
Then Google took over with their naive optimism around values of freedom and just went with ads as a "solution" to finance their whole operation in order to keep the ideal of free (ideals are always dangerous).
Now we are in a terrible situation where there is still no integrated (micro)payment nor identity system into the web browser and thus we have a seriously fucked up dichotomy: either you have content with gazillions of ads that are "free" or you have content that is only accessible with a monthly subscription, generally priced higher than what good press used to cost (which makes no sense).
This is really a problem because if you can't access everything "a la carte" web browsing is a bit pointless, being barely better than accessing media at the library or your local press stand (in fact when you count DRM issues and lack of lasting physical product, you could argue that its worse).
In my opinion the whole point of the web is that not all content is uniformly valuable in the same way to everyone. And you can't ask someone with varying interests and varying time for said interest to pay for multiple subscription to multiple sources.
And this is exactly why everything resort to ads: you can't have that many people pay subscriptions because it doesn't bring enough value to them but you also can't sell per unit because it's way too complicated/annoying for the customer to do; so, you use ads.
That being said, we should make some regulations around ad use because it's pretty obvious that some of the tech giants would not exist as they are if people really had to pay for their products. Ad use in those platforms is a pretty clear attempt at avoiding competition, you don't have to compete much if you are "free" after all (Google speciality).