Because if they’re marrying someone older that person legally becomes their guardian and there is a massive power imbalance. Marriages with minors often involve abuse because it’s difficult for the minor to leave a legal bond to their guardian.
Gender-reassignment surgery is more self-contained as it only involves one person.