Why do some reptiles have TDSD ? Is it because one of the genders is healthier than the other that only they, can survive high temperatures?
To my knowledge, it is still mainly unclear what are the enviromental factors that would promote Environmental Sex Determination (ESD; incl. TSD) vs Genetic Sex Determination (GSD; incl. with and without sexual chromosomes).
Environment variability and Climate change
Generally speaking it is thought that in variable environment, GSD might be more beneficial as an ESD mechanism could lead uneven sex-ratio and hence lower fitness (Pen et al., 2010).
Climate change can be very detrimental to species that use ESD. A sudden climatic change can cause a population to have a highly biased sex-ratio to the point where persistence is not possible anymore (Boyle et al., 2014).
Differential fitness variance among sex
On the other hand, ESD can allow parents to decide the sex-ratio of their offsprings (Randy, 2005).
Consider for example a case where sexual selection lead to a much high variance in fitness among, say, males than among females. Note that parents fitness and offspring fitness is correlated (because an obvious genetic correlation but also because some environmental correlation). In such case, parents that have a low fitness would prefer to produce females (that despite being unhealthy / ugly will still manage to have a decent fitness) while parents with high fitness would prefer to produce males (because very healthy / good looking males will have a very high fitness).
Charnov and Bull model
In Charnov and Bull (1977) own words (taken from their abstract)
We propose that labile sex determination (not fixed at conception) is favoured by natural selection when an individual's fitness (as a male or female) is strongly influenced by environmental conditions and where the individual has little control over which environment it will experience. Our argument also applies to sex expression in hermaphrodites
According to wikipedia, there are a number of evidences for this model in the literature. I let you go through the cited papers for more information about what is the logic behind this hypothesis!
Changes in sex determination systems has not evolved that many times (in Reptilia at least; Jansen and Phillips, 2006; see this post for definition of Reptilia). It can be hypothesized that there might be a strong evolutionary constraint (see also phylogenetic signal) and hence looking for adaptive reasons for its evolution might be a moot point.