functionally, spraypaint requires a thorough shake and usually comes in a much larger, harder to conceal can. Hairspray is usually fairly large as well. Pepperspray has the design advantages of being both smaller and easier to palm and conceal(meaning your attacker is less likely to shield or avert his eyes), as well as having a stronger, more effective delivery in the CO2 pushing the spray out. No shaking necessary, no prep.
You could always improvise with paint or hair spray, but it takes foreknowledge and prep that just isn't worth it in the long run. Although the advantage to hairspray is that it's much more acceptable to be found on your person as a woman in a purse if pepper spray is regulated in your area, and doubles as a flamethrower if you have a lighter to hold underneath the can.