Because building a nest is genetically wired into the bird.
I wasn't aware that we had decoded genomes to that level of detail.
Current research into genomes is primarily through correlation not causation. Right now we can barely figure out the structure of what will be produced, let alone how that will fit into the complex circuitry that makes up a bird's brain; which I might add we also don't understand from an AI standpoint.
I am not trying to say that no behaviours are encoded as "instict", simply that you must be cautious not to underestimate how much is formed anew through emergent behaviours.
i.e. how many ways can a horses leg joints move? might that simplicity be related to horses being able to walk so much sooner than babies? and if not, then why does it take humans so much longer for "instincts" to kick in.
Life would be so much easier if we could just look at the source code. -- Dave Olson