Not all software engineering positions, or software engineers for that matter, would achieve their highest productivity working from home. Some might, but certainly not all. I think of it as more of a spectrum where the more you know what you need to get done and how to do it on your own, the better you are spending the day at home. And this can vary from day to day.
There are many benefits to working from home, as well as working in an office environment, but my point is that commutes will still exist for many software engineers for a long time.
If you're at all extroverted you're probably happier in an office. I'm not even that extroverted but I imagine I would have left my job (my last day is Friday) much earlier if it were entirely work-from-home: those days tend to be more productive, and I get to smoke inside, but otherwise it's just lonely.
For example, I routinely need the use of laboratory equipment to measure pneumatic and electrical properties of the systems under control of my software. This equipment is both expensive and in some cases dangerous.
There are many benefits to working from home, as well as working in an office environment, but my point is that commutes will still exist for many software engineers for a long time.