I'm sure money is part of it, but probably not the whole story. There are plenty of surgeons involved in transgender medicine who are not doing it privately, so they don't make any additional money - they do it on the NHS or their country's equivalent, so get their normal salary, whether they do transgender work on not.
I think that, for most surgeons, the enjoyment and challenge of working on something new, especially something that supposedly completely transforms a person, is very appealing. Most put this enjoyment to benign ends, but not all.