According to this paper [1], mean comfortable walking speed for a male in his twenties is 253.3 cm/s (~5.67 mph). Assuming you are male and in your twenties, this means it takes you ~39 mins to work each way, not including stopping at intersections, etc. Contrast this to ~15 mins each way in a car.
This means the cost/benefit would go something like this:
Walking:
(+) 78 mins/day commuting + exercise
(+) Mood heightened
(-) Lesser exercise (walking vs 1 hr at the gym where, presumably, you'd do more than walk)
Driving/Gym:
(-) 90 mins/day communting + exercise
(-) Mood not heightened
(+) Better exercise
(+) More flexibility (want to go more than a couple miles for lunch? Sorry.)
My guess is that most people choose option 2 for the flexibility alone. This allows them to do their exercise when they want to. Whether or not they will is another story.
[1] http://ageing.oxfordjournals.org/content/26/1/15.full.pdf