Recrystallization is a purification method because it is a slow selective generation of a crystal framework, (mostly) free of trapped impurities. It is only effective as a purification method if done properly. Poor recrystallization techniques; rapid cooling, dramatic changes in solubility with temperature, bad choice of solvent, over evaporation of solvent, can all produce crystals of low purity which are not much better than the starting crop.
Impurities in crystals can occur via three mechanisms;
inclusion: impurities occupy a lattice site within the crystal framework; that is, they become part of a defective crystal unit themselves
occlusion: impurities become physically trapped within the crystal framework. This can be a common occurence for some solvent molecules
adsorption: impurities form a weakly bound interaction to the crystal surface.
The faster the crystallization takes place, the greater the chances these mechanisms have of occurring. Crystals are specific odd-shaped units that need to pack in nicely to their neighbours to form a good crystal. This takes time. A new molecule may attach to the growing lattice, but if it is not the right fit (such as because it is an impurity), it will leave in favour of a better suited fit attaching to the lattice. I may be showing my age here, but we used to liken crystal growth to a game of Tetris. Heck you can still play it! Done slowly, there is time to rotate all the pieces and get the perfect fit. As you speed things up, it becomes harder to get the right fit, holes are left, and before long the whole crystal goes to the dogs. That is essentially what is happening with rapid crystal growth. It's why you get smaller crystals and greater levels of impurities.
Of course, there other methods for purifying solids which are effective also, if used correctly. Precipitation, sublimation and fractional crystallization are all methods for purifying solids, which can give high levels of purity, matching purities obtained be recrystallization.