Yeah, it seems as if even if you do everything right, there's still something that will mess with the plants. Everyone has idea's of what it could be...and they're all right. ,but I'd like to add a couple of more options.
Proper early root formation is key to minimizing the possibility of leaning. Always till your soil very well.
Double dig or for bigger operations, use a subsoiler (A subsoiler breaks up the ground 18" deep, this allows for proper drainage and allows the roots to grow deeper).
Set your plants deep. A sustained source of moisture will promote proper (deep) root growth.
Nematodes. If your plants are leaning in one or several areas of your field, the problem is likely nematodes. Nematodes attack the root structure of the plants.
Just bad luck, Like I said earlier, even if you do everything right, a well prepared bed/field will have loose soil. Loose wet soil during a wind storm will cause plants to lay down every time. Sometimes you can't do anything about it. At least it isn't hail damage...there's not a whole heck of a lot you can do about that short of tenting your crop.
Heirloom varieties are subject to leaning also. Today's commercial crops have all been bread to eliminate spindly stalk, but I've grown heirlooms that grow every direction but straight.