Actually to the point he was making you are wrong. Laws are designed to regulate behavior. The law seprates out behavior and a persons race, religion or status has nothing to do with it.
The easiest form of discrimination is to regulate things that a certain group does that is not usually done by the 'Select'...
Let's say I wanted to discriminate against Muslims and Jews. I'd outlaw the Kosher diet then say, "But eating is an action!" and "Religion is a Choice!"
Laws that regulate a behavior in order to single out a specific group for exclusion are like the latter example.
We all know that Sailors can hit a port and pay a hooker to sodomize them, so long as the hooker isn't of the same sex, the Navy will turn a blind eye in almost every case (not for married men with clearances), but if one were caught with somebody of the same sex doing exactly the same thing (since oral sex counts as sodomy) whether they paid for it or not they'd be thrown out.
Since the law does not provide equal protections, and is specifically designed and applied in such a discriminating fashion, it is most definitely and deliberately discriminating against a group of individuals that are for some reason declared "pariah"...
Now, where many disagree is whether or not this discrimination is the right thing to do. Some would say such discrimination is right, but to pretend that such things are not deliberately and directly discriminatory is preposterous.
The activity is the same, even though it isn't as easy to discern as skin color. You seek to deny access to the benefits of participation that those without this "pariah" status are allowed to access; and the military does it by applying this law in a discriminatory fashion.