Where do you think the grammatical concept of gender came from? It is a natural development based on our perception of the world... there are two biological genders, hence many early societies developed languages that contain gender.
In the biological sense, there are two genders. And that dichotomy extends from the simplest bacteria to the most complex multicellular organisms.
It is not true that chromosomes always determine gender. But in humans and, I think, in vertebrates in general, chromosomes always determine gender. It isn’t always XX female and XY male—in chickens (and maybe all birds), it is the opposite.