A man can get a urinary tract infection when bacteria enter the urinary tract through the urethra, though UTIs are less common in men due to their longer urethra. Factors that increase the risk include having an enlarged prostate, kidney stones, or using a catheter. Other causes may include unprotected sex or poor hygiene, which can introduce bacteria to the urinary tract.