Yes, it masks the smell of shaving foam, which doesn't smell great. To me anyway - I know/knew a guy who shaved every morning but never put anything on afterwards, so he always had a very curious smell about him, and I hated it.
Get some shaving foam, smell it and then think about smelling like that all day and then about when you are out and about, when you start to sweat, etc etc.
There are worse smells, it's true, but in actual fact, it always reminded me slightly of some sort of mild detergent.
So yes, Aftershave (or Aftershave Moisturiser) has it's purpose - to keep ME sane!
....Either that or take a shower after you have shaved and apply moisturiser once you have finished to avoid dehydrating your skin completely (i.e. to avoid it going all red and raw).