Secondly, you can work towards a situation where you don't have that commute, or it's cheap / clean / easy / you don't lose all the time. Spoiler: live on a trainline or buy a bicycle.
Third, I don't believe this is the main reason for commuting. I think it's because people want to live in one place and work in another, which is usually a bad idea - especially for the environment. It irks me when I choose to live reasonably close to work so I don't need to burn fossil fuels to get there, and then people driving their cars to and from some village complain about their commute whilst I have to suffer the air pollution from their vehicles.
I totally get that for some transitional periods a long commute may be required, but I don't know a single person who couldn't make their commute a 20min walk or by public transport if they moved or switched jobs.
do you suggest moving every time you change jobs? I suppose that can be done as a single person or a couple, but moving homes every 4-6 years with children who have to change schools, etc is (I'm sorry) an insane proposition.
If you are single and can just up sticks from one apartment to another then yeah, it's pretty trivial.
No, just if you move to a new job that's a long journey away from your house.
Does "commuting" only mean "driving in a privately owned car" where you are based? I'd consider travelling by rail, bus or bicycle to also be commuting.
I.e public transport
There is always a choice. Ten more miles equals one extra bedroom and so on.
Are you suggesting people live at the office?
And furthermore, even if everyone was that free-roaming, only-working, highly-paid software developer you seem to consider average, still there wouldn't be enough living space really close to many offices for all employees.
You maybe did it for a larger house. Or maybe for cheaper rent/mortgage.
We're not talking here about folks on minimum wage who can only afford to live 2 hours outside of the city they are working in.
The highly paid software engineers on hackernews could absolutely afford to live 5 minutes from the office, 30 minutes from the office, or 2 hours from the office.
They could afford to move to a city with good transit where they can only afford an apartment, or to a city with no transit where they can afford a giant mansion.