Logical Explanation
Now this might sound funny, but has a logical reasoning. Sometimes, the cause for foamy urine or bubbles in urine could be nothing but the fast cascading effect, i.e., when the liquid hits a hard surface of the toilet pot or bowl, it is bound to create bubbles or the foaming effect. The elements present in the urine, its surface tension and the force with which it hits the toilet surface, are enough factors responsible for the urine to foam up.