Even if you have great transportation (Tokyo, London, New York), the commute is still pretty brutal.
The only real "solution" that was ever presented to this problem was to create smaller garden cities that would have their own industries...this never worked out because everyone had to be in the city (perhaps coincident with more service-based economies, manufacturing did move out of big cities).
It is an extremely hard problem (and to be blunt, the solution of most planners has been: make me emperor, I will allocate the resources...it is a huge political/social/everything problem) but remote working is a very legitimate solution...although the response of any company towards better conditions for workers is always suspicion (if the workers are happier, don't we lose...somehow?).
(An extremely nerdy comparison is with proto-industry in the early stages of the Industrial Revolution...a lot of the intermediate production in textiles was done in homes by, what we would call today, independent contractors...as the capital intensity of the textile industry increased and new technology was developed so...to put it bluntly...that you could employ children to do the work then you saw industry move into city centres and slums appear. But before this time, you had people working in their own homes and on their own machines, and it was far more decentralised...although these people were often localised geographically as there was a whole supply chain. Definitely indicates that things don't really need to be the way they are.)