That's the excuse, and the logic appears to make sense, but I think I recall it being tested and not really being much of a factor. That's what makes it a good dog whistle though. People will rush to say "it makes them unfit for duty because the equipment won't function" without looking further, so then the racist policies get protected and they don't have to actually justify the racism.
https://taskandpurpose.com/news/military-beards-break-gas-mask-seal/