Imiquimod can cause skin redness and fungal infection but it is less likely to cause blood in semen or hematospermia. It can occur due to many conditions such as infections, swellings (inflammations), cysts, stones & other obstructive lesions, and benign or non-benign tumors of the organs of the genitourinary system (involving the bladder, urethra, the testicles, the seminal vesicles, the epididymis, the prostate gland etc). Investigations include blood tests, routine & culture tests of urine & semen, ultrasound & MRI scans of genitourinary system, and histopathological tests (FNAC, biopsy etc).
It is very difficult to precisely confirm a diagnosis without examination and investigations and the answer is based on the medical information provided. For exact diagnosis, you are requested to consult your doctor. I sincerely hope that helps. Take care and please do keep me posted on how you are doing.
Thank you for your response, doctor. Fortunately the hematospermia has not occurred again since that one time, so I haven't consulted my doctor about it yet.