The semen or sperm getting yellow is likely due to prostatic infection (prostatitis). A semen and urine culture would give a fair idea about the infection. A course of antibiotics can easily treat this. Please read this resource;
Please feel free for your follow up questions.