This is because facial hair can interfere with the seal of a pilot's oxygen mask, which could be disastrous at high altitudes (but has been disproven by recent studies). In addition, beards can make it difficult to put on a headset or helmet properly, which can impede communication with air traffic control.