Sexual comments are inappropriate. My company has clear policies around this. Everybody is trained annually and this sort of thing is not tolerated.
Having said that, there absolutely are a lack of woman coders at my company. I want to change that, but before I can, women must apply. This is why the "Girls who Code" program was created. So, I am sorry if there presently is a lack of diversity, but I wish to change it and if you wish to as well you may have to tolerate being a member of a small number of female programmers in a male dominant world. You can expect your male colleagues to treat you with respect. We only get the numbers up if you join us.
Now if you're seeing a lack of cultural diversity, I'm not sure where you're looking. My company is VERY culturally diverse and actually has lots of women employees, many of whom are in leadership roles. We just don't have a lot of women who code, and I'd like to change that, because the women whom I do have are excellent and comprise 50% of my team leads.