It can be due to proteinuria which requires further evaluation. Large amounts of protein in urine may indicate a serious kidney problem.
Urinary tract infections (UTIs) and retrograde ejaculation are 2 other possibilities. In men, the most common source of the infection is the prostate gland (prostatitis).
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.