It seems like it happens randomly. Sometimes I can use a can of spray paint on a dozen different occasions with the same nozzle and it never clogs up. Sometimes they clog up after the first use. Sometimes they even clog up suddenly while I’m using them! And then it seems impossible to unclog without damaging the nozzle. What exactly causes nozzles to suddenly clog up and how can it be prevented or fixed?
DISCLAIMER: I've never actually used spray paint.
The clogging is caused by dry paint mainly. To prevent this the paint manufacturers advice, after you've finished using it on the occasion, to turn it upsidedown and spray away the paint that was left in the tube-ways, so that there will be no paint left to dry and cause clogging.
Another reason for clogging is poor quality paint (most likely the reason it cloggs all of a sudden in miduse). I don't think there is anything you can do about it (exept for buying a different brand of paint).
As a last resort you could try soaking the clogged nozzle in paint solvent for a while, but I don't know if that would make any difference.