Interplanetary magnetic clouds are expanding MHD configurations characterized by strong magnetic fields, large rotations of the field vector, and low ion temperatures. In this paper we present high time resolution data from the ISEE 3 and IMP 8 spacecraft on the magnetic field and the proton and electron populations in a number of magnetic clouds. Our objective is to study aspects of the thermodynamics of magnetic clouds and the relation between their thermodynamic and magnetic structures. Our analysis suggests the following features of the thermodynamics of magnetic clouds: (1) The electron and ion populations are not in thermal equilibrium with each other, the electron temperature, Te, being in general up to an order of magnitude higher than the proton temperature, Tp. The temperature ratio Te/Tp in these magnetic clouds is larger than typical values of this quantity in the solar wind at comparable heliocentric distances. (2) For the proton component we find that a polytropic law with γp in the range 1.1 < γp < 1.3 is probably adequate to describe the relation between Tp and density. (3) For the electrons (E < 1.18 keV) the energetics are likewise governed by a polytropic law. Unlike the protons the polytrope that describes the electrons has an index that is less than unity, implying anticorrelation between Te and the number density. For the two clouds analyzed where electron data are available, γe ≈ 0.48 ± 0.2. (4) As a corollary of case 3, the variation of Te with density in magnetic clouds is the reverse of that generally found in the inner heliosphere. (5) Electron temperatures are well correlated with the magnetic field strength, the highest values being reached where the field strength maximizes. We interpret these experimental findings along the following lines. While the magnetic field of the cloud expands, the ions are cooled (though not so effectively as in the adiabatic case (γad = 5/3), indicating some exchange of energy with the ambient solar wind). In contrast, since γe < 1, when the density drops as a result of expansion, Te increases and, consequently, a temperature difference develops between the two species. The hot electrons are trapped by the magnetic field in the core of the magnetic cloud. If magnetic clouds originate in the region near the Sun where Tp < Te, the subsequent expansion accentuates this temperature disparity further. Such conditions are favorable for the generation of ion acoustic waves.