The male reproductive system isn't capable of producing like a machine gun, which you grab whenever you wish and hit the trigger on. I'd wager that the original poster went overboard during a session of self-gratification, and experienced more OPH (orgasms per hour) than his system was capable of supporting. Thus overstressed, blood became extruded into the semen from the affected tissue or duct.
Each person is different, but generally speaking, you have to abide by a form of HOMEOSTASIS. If you ejaculate infrequently, don't try to enter a 'wackathon' or 'sexathon' where you expect to experience over 2 orgasms. Your semen-producing glands will overstress and likely exude some blood.
By the same homeostasis token, a frequent producer shouldn't just go "cold turkey", since his glands will be used to a certain level of semen production. While ramping down, so to speak, a few bouts of masturbation over some days can help get all those glands to relax down to the new level of less frequent usage.
Barring issues of abrupt changes in frequency, blood in the semen is not a good sign and a doctor might be consulted. Chances are, he's going to ask about your sex life, to look for the indicators I just spoke about.
Remember, folks: treat the penis with the same respect you'd treat a power tool and you will be well prepared to use it responsibly. It can break, overheat, and is very dangerous to the user and others (since impregnation leads to the production of children).
This happened to me twice. I got a little worried after the 2nd time, but it never happened again, so I ignored it. If it was prostate cancer, I find it unlikely to grow big enough to leak blood, then suddenly regress to 0 again. I'm also 20, so prostate cancer is rather unlikely. I'm also a virgin, so venereal diseases is also very unlikely.
I'll assume what happened to me was what >>4 described.