Interestingly, some research in Zdorovye (Health) weekly indicates spitting is better.
You see, the human immune system responds to the protein coats on he outside of invading cells. When unusual protein signatures are discovered, it results in the production of antibodies to neutralise it.
Sperm provides this same alien protein, while spermatozoa represent viruses and bacteria to fight. In woman’s body, the mucous membrane of the womb and the vagina stops this fight. Unfortunately, when sperm gets into the stomach or the rectum, it is immediately interpreted by the immune system as infection. The body can start to produce antisperm agents, which are not blocked by the mucous membrane. These agents attempt to eliminate 'germs' in the vagina. This could reduce the chances of getting pregnant.
Obviously, I cannot speak to the reliability of this evidence, but it seems more compelling than the reason for swallowing, i.e. because the guy likes it.
In summary, it may be wise to spit rather than swallow. Similarly, you should probably wear a condom if/when having anal sex; it also reduces the risk of other STDs.