This is one of those causation vs correlation 101 things. Who lives within 2 miles of their workplace? Typically either young active people, rich people, or single types who would prefer a small place with a city lifestyle.
Who has the longest commutes? Poor people, older people with children who need bigger places, or people who for whatever reason don't like being near the hustle and bustle of the cities.
Big surprise, lots of confounding variables in these two very different self selected groups. Turns out older/poorer people with lots of obligations tend to have sleep problems.