Yes it is a question of illegality. The military is now legally prohibited from having any MOS reserved for males only.
I get that.
At the same time the military can put anyone where it wants to. If women in infantry units decreases capability and mission success, it can put them in other places where they won’t jeopardize fighting units and mission success probabilities.