Persistently foamy urine can be a sign of protein in your
urine (proteinuria), which requires further evaluation. Large amounts of protein in
urine may indicate a serious kidney problem. In your case it appears to have been ruled out. 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).
Hope this helps. It is difficult to comment beyond this at this stage.