Why do spokes loosen? Is it true that the they twist small amounts as you hit bumps while you ride, and that's why they loosen?  Would gluing spoke nipples simply solve this problem?
I have to say I think this is a myth, for a properly built wheel.

Spokes have threaded ends which the nipples screw onto. Like almost all screw threads, they are self-locking. Since the spokes of a properly built wheel are under a high level of tension, there is no "play" in the threads. In addition, any torque would have to overcome the high clamping force the nipple head is exerting on the wheel rim.

For the spokes to loosen, the load would have to deform the rim enough to relieve the spoke of all tension so that the nipple can turn. If the spokes are this loose they would readily flex sideways if you pressed on them.

There is some potential for spokes to loosen a little with a newly built wheel, if the builder has not relieved the spoke torsion. In this situation the torsion in the spoke shaft can overcome the clamping force, and wheel will go out of true in the first few km of use. 

See


Wikipedia: Screw_(simple_machine)
Vibration Loosening of Bolts and Threaded Fasteners
Sheldon on Wheelbuilding