Why do many sites leave half of each webpage empty?

Why do many sites leave half of each webpage empty? Isn't this a waste of screen space?

One nice example of this is the Stack Exchange Network sites:

Screenshot of UX Stack Exchange with annotations

As you can see, there is a ton of whitespace left on both sides of each page.

Does the whitespace make sites compatible with certain screen sizes?
Does leaving the space help make sites mobile friendly?
Does space make pages seem less crowded, and thus, more usable?
Or, is there no good reason and people just do it because they don't realize they shouldn't?

I've worked on sites that use both designs and haven't had users complain either way.

Examples of sites that have space: Stack Overflow, GitHub, Facebook
Examples of sites without space: Amazon, Chase, Gmail