Why do some mammals not have testes in a scrotum?
Having descended testes is a derived characteristic within mammals; monotremes and the Afrotheria (including elephants) all retain the ancestral character state (Kleisner, et al., 2010)2. Among those mammals with descended testes, these can be ascrotal or scrotal. Testicular descent is hypothesized to have only occurred once within Mammalia, with the ascrotal Laurasiatheria. Descended ascrotal testes are found in cetaceans, phocid seals, hippos, tapirs, rhinos, and some bats. Descended scrotal testes are found in horses, pigs, camels, and Carnivora.

Since basal mammals would presumably have to regulate testicular temperature just as much as derived mammals, the temperature regulation hypothesis seems to not hold up. So the real question is: why have a scrotum? One hypothesis has to do with evolution of fast locomotion (e.g., galloping).

According to Frey (1991, 40)4:


  The strong flexions and extensions of the vertebral column during
  gallop should cause intense fluctuations of intra-abdominal pressure.
  Fluctuations of intra-abdominal pressure severely impede continuous
  flow of blood in the abdominal veins. Periodically reduced venous
  drainage resulting in fluctuations of intra-testicular pressure would
  impair the process of spermiohistogenesis, which is dependent on an
  absolutely constant pressure within the testis.


Chance (1996)5 suggests that the temperature hypothesis might represent a secondary adaptation:


  Because in the human male, scrotal testes function optimally at
  temperatures below that of the body, much speculation, and a
  considerable amount of research, has gone into attempting to see what
  (metabolic) advantage might accrue from this lower temperature,
  without considering the possibility that this is a secondary
  adaptation to an enforced external position.


Kleisner, K., Ivell, R., and Flegr, J. 2010. The evolutionary history of testicular externalization and the origin of the scrotum. J Biosci 35:27-37

Frey, R. 1991. Zur Ursache des Hodenabstiegs (Descensus testiculorum) bei Säugetieren. Z Zool Sys Evolut-Forsch 29:40–65

Chance, M.R.A. 1996. Reason for externalization of the testis of mammals. J Zool 239:691–695