Collisions have been thought to be the dominant process altering asteroid rotations, but recent observations of the Koronis family of asteroids suggest that this may be incorrect. This group of asteroids was formed in a catastrophic collision several billion years ago; in the intervening period their rotational axes should have become nearly random because of subsequent collisions, with spin rates that follow a maxwellian distribution. What is seen, however, is that the observed family members with prograde spins have nearly identical periods (7.5-9.5h) and obliquities between 42 and 50 degrees, while those with retrograde spins have obliquities between 154 and 169 degrees with periods either <5h or >13h. Here we show that these non-random orientations and spin rates can be explained by `thermal torques' (arising from differential solar heating), which modify the spin states over time. In some cases, the asteroids become trapped in spin-orbit resonances. Our results suggest that thermal torques may be more important than collisions in changing the spin states (and possibly shapes) of asteroids with diameters <40km.