High temperatures violate the Constitution’s protection against cruel and unusual punishment, the judge ruled.