There a few reasons for being clean shaven...
A. As mentioned above, what would you think if you walked up to the gate and saw the Captain/FO boarding the plane having not shaved in a week? You'd be a little apprehensive. Take that same situation and have the Captain and FO clean shaven and looking professional... which flight would you rather take?
B. You're representing a professional company in a professional environment. You're not going to do a very good job of representing if you look like you've been living on the streets for the last week.
C. Probably the most important one right here. In the event that you lost pressurization at altitude and had to dawn the oxygen mask, it's not going to do you a lot of good if you've got a ton of facial hair and the oxygen is leaking out because if cannot get a good grasp around your face. Being clean shaven allows the oxygen mask to fully grasp your face to make an airtight seal to give you 100% oxygen flow in the even of an emergency.