There really does seem to be an effect like this. Your day job could be a piano player in a brothel but as soon as you put on the uniform, it’s as if you’ve never met women before. I suspect there’s something about putting on the uniform for a lot of guys that reminds us of Basic Training, where (for most of us) there were no females. For some reason this effect continues to linger in the blood decades later. While sometimes it can lead to problems, most of the time it ends up just making people look foolish.