It is because a child who inherits an X chromosome from her father will be a girl and one who inherits a Y chromosome from his father will be a boy. But all children inherit a X chromosome from their mother regardless of whether they are boys or girls.