I'm not very surprised, given the history of sexuality in that region (though the strong language used by the clerics is remarkable).
Yep, this shouldn't come to a surprise to anybody, Pakistan have the so called third gender, which is a integrated part of their culture. Also if we look to their neighbour in Iran, it have been a policy for years, where they recognise transgender people as having been born in the wrong body. So the Iranian seek treat transgendered not as a mental disorder, but as a physical one, which can be cured by people being changed into their correct gender.
As such this seem less of liberal cleric and more "a broken clock being right twice a day".
Yeah, I've always found that historical and modern context to be fascinating, if a bit horrifying. Enlightened and modern views on transgender people (moreso than many on this forum, for that matter), but very regressive views on openly gay people.