It's important to note that in this case the purpose is not to match the individual's declared gender against, say, their own passport or birth certificate, but instead to match it against TSA'a watch list for terror suspects. In the new federal rules for Secure Flight (PDF), TSA explains why it is asking about gender:
Many names are gender neutral. Additionally, names not derived from the Latin alphabet, when translated into English, do not generally denote gender. Providing information on gender will reduce the number of false positive watch list matches, because the information will distinguish persons who have the same or similar name. Consequently, TSA is including gender as a required element of the SFPD, which covered aircraft operators must request from individuals and which individuals must provide to the covered aircraft operator.Thus, TSA has no reason to care about your gender as such - it wants to quickly and efficiently tell whether you might be the same "Lee Anderson" or "Alex Parker" as the one on its list. In its explanation of the program for travel agents (PDF), TSA says that "Aircraft operators will collect gender based on the declaration of the individual making the booking." Thus, according to the way the program is supposed to work, they are just comparing the passenger's declaration to the watch list.
In practice, it's not likely to be that simple. As the Human Rights Campaign noted in its opposition to the proposed regulations (PDF), it's not clear whether enhanced screening of an individual will, in practice, result if airline staff happen to notice a discrepancy with the passenger's identity documents. Airlines may feel it's simply the right thing to do, because gender discrepancies are viewed as suspicious - and the regulations give them authority to decide that. Likewise if an individual declines to make a declaration about gender. Moreover, the regulations provide for hefty fines for those making a false statement about any required data, including gender. How will it be decided if someone's declaration regarding their gender is "false"? Even if no transgender folks are ever fined, they have reason to fear the process.
While TSA's makes a logical argument that gender data would be helpful to them in streamlining the process, they haven't and can't make the case that it's necessary. If this requirement helps prevent harassment and inconvenience for some travelers by eliminating erroneous matches, it will simultaneously cause the same and potentially even worse problems for transgender travellers.
The Obama administration wasn't in on the process of writing these rules, which were finalized last October. It's not clear if these are among the regulations the administration is reviewing and may reverse, but TSA appears set to go ahead with rollout of the program.