How is gender defined? What the ontological status of gender is depends on who you ask. For some of the far-right, gender is practically synonymous to sex. You have a penis? Good, you'll be the muscles of the family, the one who goes to war, the one who votes, etc. You have a vagina? Good, you'll be the baby-maker of the family, the one who stays home taking care of the kids, the one who supports her husband, etc. For some of the far-left, gender is entirely different from sex. You wanna be a dude, or a chick, or neither, or both, or a tree, or a unicorn or a dolphin, you go right on ahead and be that!
The problem with the uber-conservatives is that they are trying to impose social expectations on sexes that are no longer needed, nor perhaps even moral. The female sex should be allowed to vote, the male sex should not be expected to volunteer for the military, etc. On the other hand, the problem with uber-liberals is that they are so focused on not offending anyone that they completely lose any legitimacy. If you think you're a unicorn, then we're going to need to start changing our definitions of unicorns to include those who look like a human but are unicorns in disguise. For these liberals, gender becomes something to experiment with, caused by an excessive amount of free time and comfort. I don't particularly have a "big" issue with calling yourself something silly like a unicorn, but as soon as you expect others to actually respect your new gender and give you all sorts of benefits for "being different", we're going to have a problem.
So gender is a set of personality traits and social expectations that traditionally depended on what sexual organs you possessed but now tends to be loosely associated with these organs.
What I would prefer, however, is if we just throw out the whole concept of gender. Does it really matter?! Some would argue it does - mostly because they're concerned about homosexual or bisexual relationships (girls need to act like girls, guys need to act like guys, it's all clean and pretty and a well-oiled machine...). They're concerned about keeping things the way they have been, despite there no longer being a need.
Instead, we should make it so that your personality and the way you act is motivated by who you wish to be associated with. Done deal.