Hi
Welcome to the MedHelp forum!
Generally blood in sperm or hematospermia is due to non specific prostatitis or due to a tear in one of the veins of the prostate (prostatic varices). In your case it could be due to repeated ejaculation after some abstinence from masturbation too.
Other than this it can be due several causes like benign or malignant tumors of the prostate, bladder, testes, or seminal vesicles; infections like chlamydia, herpes, cytomegalovirus, and trichomoniasis (not likely as you have not had sex for a long time); prostatitis (infection of prostate), epididymitis (infection of epidiymis), or urethritis; stone in the seminal vesicles or prostate, polyps in the urethra, obstructions in ejaculation-duct, and cancers of genitourinary system.
If this repeats consult an urologist. You may need blood and urine tests and prostate examination. Hope this helps. Do let me know if there is any thing else and keep me posted. Take care!
I would also post in the Sexual Health and Mens' Health Forums as well.