Sex of baby depends on dad's attitude
This movie was like so many movies in that when the dad is uneasy about the pregnancy, he is suddenly redeemed and feels OK about being a dad when it turns out to be a boy. This happened in the movie "9 Months" as well. It's sad when movies tell us that a dad will care more if his baby is a boy, even though there are many dads out there who cherish their girls.
The opposite situation crops up in "Knocked Up": there the father makes an effort to go from irresponsible pothead to a responsible father-to-be. He really has worked harder on himself than the mother and has mentally made the decision to do right by his child, so the movie has him having a girl because he is secure in himself.