Essentially gender is something which is subjectively defined through a bunch of characteristics, e.g. your sex along with masculine and feminine traits. Key word in that sentence being subjectively.
Saying somebody has to gender identify as a male despite exhibiting predominantly feminine traits just because they are biologically male is quite simply ignorant. It also makes sense that somebody doesn't want to identify as either.
Honestly, just understand that gender is subjective and it really doesn't matter how you choose to identify.
tl;dr: Sex is based on biological differences while gender is generally based on social, cultural and biological differences.