Sikhs are allowed to wear beards and still be in uniform. The problem with Hasan was that his claim of religious requirement was demonstrably false because he had no problem being clean shaven until he was arrested for murdering and wounding so many of his fellow soldiers.
The military standards of short hair and clean shaven were really hygienic requirements that started with the mass induction armies of the 20th century. Beards and even long hair were relatively common in the 19th century.
Bottom line for me though is that the armed forces are volunteer, not conscript, these days so everyone coming in has made a conscious decision to do so in spite of any standards or regulations that annoy/bother them. This isn't a cafe where they can say "I'll have the no-deductible health care plan and free flu shots but I'll pass on the clean pressed uniform and shaving every day".