  We present a spherically symmetric model for the origin and evolution of the
temperature profiles in the hot plasma filling galaxy groups and clusters. We
find that the gas in clusters is generically not isothermal, and that the
temperature declines with radius at large distances from the cluster center
(outside the core- and scale radii). This temperature profile is determined by
the accretion history of the halo, and is not quantitatively well-described by
a polytropic model. We explain quantitatively how the large-scale temperature
gradient persists in spite of thermal conduction and convection. These results
are a consequence of the cosmological assembly of clusters and cannot be
reproduced with non-cosmological simulations of isolated halos. We show that
the variation in halo assembly histories produces a ~10% scatter in temperature
at fixed mass. On top of this scatter, conduction decreases the temperature of
the gas near the scale radius in massive clusters, which may bias hydrostatic
mass estimates inferred from x-ray and SZ observations. As an example
application of our model profiles, we use mixing-length theory to estimate the
turbulent pressure support created by the magnetothermal instability (MTI): in
agreement with our earlier MHD simulations, we find that the convection
produced by the MTI can provide ~5% non-thermal pressure support near r_500.
The magnitude of this turbulent pressure support is likely to be non-monotonic
in halo mass, peaking in ~10^14.5 M_sun halos.
