For general hardness and strength, I would choose a hardwood.
To resist cracking, I would choose a diffuse porous wood, and avoid grain runout (wood fibers should be approximately parallel to the sides)
Maple would be ideal. Cherry or birch would be good too.
Ring porous woods like oak, ash, or hickory are more prone to crack. These woods are deliberately chosen for basketweaving because they split easily. However, they should be fine if they are they are thick enough, or have few enough holes.
Softwoods are the weakest choice for a small structural piece, as the screw holes can wear out. Still, it's OK if the size of the wood/screws is appropriate.
One more note: Avoid cross grain gluing to avoid cracking the headboard. In other words, you can glue the new piece to the vertical post since the grain of the two pieces is parallel. But if you glue it to the headboard, it will try to prevent the headboard from shrinking in the drier months, and the headboard could crack.