Honestly this is very close to gender discrimination, which is clearly illegal. If you created an environment that only young male developers will enjoy how is that much different then explicitly saying you won't hire any female developers?
To me it's in a similar vein of when literacy tests were employed in the South to prevent African Americans from voting. It wasn't saying you couldn't vote if you were black but it had the same effect of denying most blacks suffrage anyway. So you're not saying women can't work here, but we're just going to encourage/promote a culture that isn't one most women would want to be a part of anyway.