Because that group are their main consumers. You said women are almost half of gamers, but that is all games, including casual ones. For the titles you mentioned (COD/assassin's creed), men are still the main audience. It's consumer targeting.
Basically this. It's a bullshit feedback loop fueled by money. One group buys a game > Marketing starts to put a larger amount of money to advertising to that group > that group buys the game more >Marketing puts an even larger amount of money to advertising to that group etc.
Over time, this has led to the completely ridiculous ads you sometimes see.
Most of the time, the games don't even do that kind of stuff in the beginning, but then marketing starts saying "Ok, we need this and that to boost sales" [MMO armor. seriously.], and then the game is tarnished by that.
Of course, some gave devs are sexist dicks, but the amount of them (per capita of game devs) should be roughly the same as the amount in a larger population. Often, as far as I can tell, they (the game devs) are forced to do this shit on danger of losing their jobs.
Slowly, they're realizing that they'd make more money if they stopped this crap, and are tuning it back. Still, MMO armor.
Took a while, but still relevant, I think.