Having served 8 years in the military, I may have a better insight than others on this policy. For the most part, a person's sexual orientation was of little consequence just as long as they got the job done. There have been gays in the military since the Revolutionary War. Keep in mind that I was in the Air Force, which tends to attract the higher end recruits, those looking to use the military as a stepping stone to a career in which they can use their training. Those who choose to join the Army and Marines tend to not be as enlightened and may not be as accepting of gays, especially in a combat situation. Remember, it wasn't that long ago where judges would often give defendants the choice of jail or the military, so we are not talking the cream of the crop in some cases. how accepting do you think Psycho (Francis) from Stripes would be if he knew that there was a gay in their squadron?
Don't ask, don't tell works but don't be naive to think that it is 100%.