The problem with basing federal civil rights laws on government defined groups is that the government can at any time redefine or remove group definitions. One moment you might be a member of a protected group as defined by the federal government, the next moment you might not:
WASHINGTON — The Trump administration is considering narrowly defining gender as a biological, immutable condition determined by genitalia at birth, the most drastic move yet in a governmentwide effort to roll back recognition and protections of transgender people under federal civil rights law.
[…]
Now the Department of Health and Human Services is spearheading an effort to establish a legal definition of sex under Title IX, the federal civil rights law that bans gender discrimination in education programs that receive government financial assistance, according to a memo obtained by The New York Times.
Libertarianism, being an individualistic philosophy, argues that all should be equal under the law. This article demonstrates why. The principle that all are equal under the law is meant to take away the government’s ability to give and take protections willy nilly.
Of course it’s impossible for everybody to be equal under the law as soon as a government is established because members of a government by definition have privileges that people outside of the government lack (one of those privileges being the ability to define what protections exist). But I digress.
As soon as any individual is made unequal under the law the door is open for making other individuals unequal under the law. Title IX was meant to guard against gender-based discrimination in federally financed educational programs and activities. However, this law only came into existence because all were not already equal under the law. Instead of fixing the root of the problem, a group of politicians decided that two legally defined groups, men and women, should enjoy the same privileges from federally financed educational programs and activities. These protections were later expanded to transgender individuals by the previous administration. Now the current administration is proposing to redefine the applicable groups in such a way that transgender individuals lose Title IX protections.
Debates like this are inevitable when legal protections are granted collectively to legally defined groups instead of equally to every individual.