In people with recurrent urinary tract infections and long-term catheterization, there is a phenomenon that can occur where the urine turns purple. Not surprisingly this is called Purple Urine Bag Syndrome, or “PUBS” for short. It usually happens to folks who are more chronically debilitated, and more often in women than men. Bacteria containing certain enzymes cause the formation of red and blue pigments. And as you probably remember from elementary school, that combination produces purple.
Here is a paper from the International Journal of Nephrology (study of the kidneys) that goes into detail about Purple Bag Syndrome: