More than two genders: Treating gender as factor or logical (for propensity score matching)? I am matching two samples using a propensity score  (I am using the MatchIt package in R as described here: https://www.r-bloggers.com/2016/06/how-to-use-r-for-matching-samples-propensity-score/). One variable is gender. Traditionally, gender is classified either as male or female, hence, the variable is binary/logical. However, I want to be inclusive and ask for different genders than male or female. Most participants, except about 1%, still self-describe as male of female. So I am not sure, whether one should treat the variable gender as a discrete (factor) variable despite the fact that most participants self-describe as either male or female?
I am not familiar enough with the mathematics behind the propensity score to know, whether this actually makes a difference.

If you do this then yes, it should be treated as a categorical variable with more than two categories.  Statistically, there is nothing unusual about this --- we use categorical variables all the time.  However, the obvious problem is that you will only get a small amount of data in the other categories, so the variability for the inferences for those categories will be large.
In terms of whether or not to do this, that really depends on whether you think the non-standard gender categories are an important "omitted variable" or whether you think its inclusion would be "over-fitting".  There is a well-developed literature for the effect of omitted variables and overfitting in various kinds of models; for discussions in the context of propensity score models, see e.g., Arpino and Mealli (2011), Li (2012), Shuster, Lowe and Platt (2016) and Lenis, Ackerman and Stuart (2018).
Realistically, it would take a lot of data to get decent inferences about an effect for categories that are so small.  You are probably going to find that you get an over-fitting problem if you add a category like this for such a small group.  Indeed, it would not be surprising if you end up with one or more categories of one person (or no people) which will mean that the coefficient for that category will completely swallow the residual (or be non-identifiable) and you will get over-fitting.
