Purely coding, gender may have no relationship to individual code quality.
The desire to have diverse teams comes from studies that show a correlation between team diversity and making better decisions. A team with diverse backgrounds is likely to consider more options and bring up more concerns. That is important when doing design work or code review.
I agree. HR is constantly trying to train managers to write more inclusive job descriptions. I also wonder how many female candidates are lost in pre-screening.