Persistent spraying occurs in unneutered males as a form of territory marking. But some unspayed females spray also. Note that in some cases, a cat who has been neutered and hasn't sprayed, may start doing so when it is very stressed, such as when you bring a new person or animal into the house. If that happens, lavish a great deal of affection on the cat and try to eliminate the stress factor. He has worms, or he's always shaking his head and spraying black gook around.
Cats are just normally dirty.
Check with your vet - both of those are easily fixed. Medication for the treatment of worms is easily and inexpensively obtained from your vet. If your cat is constantly shaking his head or scratching at his ears, he has ear mites. Get a dog instead. That's an old, untrue, wives tale.