Temperature is proportional to the kinetic theory of molecules of the gas.
The above example assumes that the cloud will stay transparent during the whole collapse. At some point it becomes opaque and traps all the heat - At this point the cloud can not get rid of the energy of collapse by conduction to the surface and radiation. The result is an 'adiabatic' condition meaning all the energy of collapse goes into the internal energy and the cloud is no longer constant temperature. The conditions have change and the trapped heat supports the collapsing cloud. At that point if the mass is not large enough to attract itself against the internal pressure it will not collapse any farther.